diff mbox series

[meta-oe] linpack: fix build with gcc-15.0.1

Message ID 20250401071820.872584-1-mark.yang@lge.com
State Under Review
Headers show
Series [meta-oe] linpack: fix build with gcc-15.0.1 | expand

Commit Message

mark yang April 1, 2025, 7:18 a.m. UTC
From: "mark.yang" <mark.yang@lge.com>

* fix following error:
    linpacknew.c: In function 'dgefa':
    linpacknew.c:257:9: error: conflicting types for 'idamax'; have 'int(void)'
    257 |     int idamax(),j,k,kp1,l,nm1;
        |         ^~~~~~
    linpacknew.c:63:13: note: previous declaration of 'idamax' with type 'int(int,  REAL *, int)' {aka 'int(int,  double *, int)'}
    63 | static int  idamax   (int n,REAL *dx,int incx);
        |             ^~~~~~
    linpacknew.c:272:21: error: too many arguments to function 'idamax'; expected 0, have 3
    272 |                 l = idamax(n-k,&a[lda*k+k],1) + k;
        |                     ^~~~~~ ~~~
    linpacknew.c:257:9: note: declared here
    257 |     int idamax(),j,k,kp1,l,nm1;
        |         ^~~~~~
    linpacknew.c:326:21: error: too many arguments to function 'idamax'; expected 0, have 3
    326 |                 l = idamax(n-k,&a[lda*k+k],1) + k;
        |                     ^~~~~~ ~~~
    linpacknew.c:257:9: note: declared here
    257 |     int idamax(),j,k,kp1,l,nm1;
        |         ^~~~~~

    The function was already declared as static int idamax(int n, REAL *dx, int incx);
    on line 63, but it was redeclared as int idamax() inside the dgefa function on line 257,
    causing a conflict.
    where functions are redeclared without parameters,
    causing conflicts with the original function definitions.

Signed-off-by: mark.yang <mark.yang@lge.com>
---
 ...in-gcc-15.0.1-due-to-function-redecl.patch | 55 +++++++++++++++++++
 .../recipes-benchmark/linpack/linpack_1.0.bb  |  1 +
 2 files changed, 56 insertions(+)
 create mode 100644 meta-oe/recipes-benchmark/linpack/linpack/0001-Fix-build-error-in-gcc-15.0.1-due-to-function-redecl.patch

Comments

Khem Raj April 1, 2025, 2:20 p.m. UTC | #1
Hello Mark

Thanks for these fixes. Do you intend to send this patch upstream as well ?

On Tue, Apr 1, 2025 at 12:18 AM mark.yang via lists.openembedded.org
<mark.yang=lge.com@lists.openembedded.org> wrote:
>
> From: "mark.yang" <mark.yang@lge.com>
>
> * fix following error:
>     linpacknew.c: In function 'dgefa':
>     linpacknew.c:257:9: error: conflicting types for 'idamax'; have 'int(void)'
>     257 |     int idamax(),j,k,kp1,l,nm1;
>         |         ^~~~~~
>     linpacknew.c:63:13: note: previous declaration of 'idamax' with type 'int(int,  REAL *, int)' {aka 'int(int,  double *, int)'}
>     63 | static int  idamax   (int n,REAL *dx,int incx);
>         |             ^~~~~~
>     linpacknew.c:272:21: error: too many arguments to function 'idamax'; expected 0, have 3
>     272 |                 l = idamax(n-k,&a[lda*k+k],1) + k;
>         |                     ^~~~~~ ~~~
>     linpacknew.c:257:9: note: declared here
>     257 |     int idamax(),j,k,kp1,l,nm1;
>         |         ^~~~~~
>     linpacknew.c:326:21: error: too many arguments to function 'idamax'; expected 0, have 3
>     326 |                 l = idamax(n-k,&a[lda*k+k],1) + k;
>         |                     ^~~~~~ ~~~
>     linpacknew.c:257:9: note: declared here
>     257 |     int idamax(),j,k,kp1,l,nm1;
>         |         ^~~~~~
>
>     The function was already declared as static int idamax(int n, REAL *dx, int incx);
>     on line 63, but it was redeclared as int idamax() inside the dgefa function on line 257,
>     causing a conflict.
>     where functions are redeclared without parameters,
>     causing conflicts with the original function definitions.
>
> Signed-off-by: mark.yang <mark.yang@lge.com>
> ---
>  ...in-gcc-15.0.1-due-to-function-redecl.patch | 55 +++++++++++++++++++
>  .../recipes-benchmark/linpack/linpack_1.0.bb  |  1 +
>  2 files changed, 56 insertions(+)
>  create mode 100644 meta-oe/recipes-benchmark/linpack/linpack/0001-Fix-build-error-in-gcc-15.0.1-due-to-function-redecl.patch
>
> diff --git a/meta-oe/recipes-benchmark/linpack/linpack/0001-Fix-build-error-in-gcc-15.0.1-due-to-function-redecl.patch b/meta-oe/recipes-benchmark/linpack/linpack/0001-Fix-build-error-in-gcc-15.0.1-due-to-function-redecl.patch
> new file mode 100644
> index 0000000000..783a98f114
> --- /dev/null
> +++ b/meta-oe/recipes-benchmark/linpack/linpack/0001-Fix-build-error-in-gcc-15.0.1-due-to-function-redecl.patch
> @@ -0,0 +1,55 @@
> +From a1c1211fd6fc8d82053074c6dc531340f046c8d4 Mon Sep 17 00:00:00 2001
> +From: "mark.yang" <mark.yang@lge.com>
> +Date: Tue, 1 Apr 2025 16:06:56 +0900
> +Subject: [PATCH] Fix build error in gcc 15.0.1 due to function redeclaration.
> +
> +Fix build error:
> +linpacknew.c: In function 'dgefa':
> +linpacknew.c:257:9: error: conflicting types for 'idamax'; have 'int(void)'
> +  257 |     int idamax(),j,k,kp1,l,nm1;
> +      |         ^~~~~~
> +linpacknew.c:63:13: note: previous declaration of 'idamax' with type 'int(int,  REAL *, int)' {aka 'int(int,  double *, int)'}
> +   63 | static int  idamax   (int n,REAL *dx,int incx);
> +      |             ^~~~~~
> +linpacknew.c:272:21: error: too many arguments to function 'idamax'; expected 0, have 3
> +  272 |                 l = idamax(n-k,&a[lda*k+k],1) + k;
> +      |                     ^~~~~~ ~~~
> +linpacknew.c:257:9: note: declared here
> +  257 |     int idamax(),j,k,kp1,l,nm1;
> +      |         ^~~~~~
> +linpacknew.c:326:21: error: too many arguments to function 'idamax'; expected 0, have 3
> +  326 |                 l = idamax(n-k,&a[lda*k+k],1) + k;
> +      |                     ^~~~~~ ~~~
> +linpacknew.c:257:9: note: declared here
> +  257 |     int idamax(),j,k,kp1,l,nm1;
> +      |         ^~~~~~
> +
> +The function was already declared as static int idamax(int n, REAL *dx, int incx);
> +on line 63, but it was redeclared as int idamax() inside the dgefa function on line 257,
> +causing a conflict.
> +where functions are redeclared without parameters,
> +causing conflicts with the original function definitions.
> +
> +Signed-off-by: mark.yang <mark.yang@lge.com>
> +
> +Upstream-Status: Pending
> +---
> + linpacknew.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/linpacknew.c b/linpacknew.c
> +index c656082..5c8687b 100644
> +--- a/linpacknew.c
> ++++ b/linpacknew.c
> +@@ -254,7 +254,7 @@ static void dgefa(REAL *a,int lda,int n,int *ipvt,int *info,int roll)
> +
> +     {
> +     REAL t;
> +-    int idamax(),j,k,kp1,l,nm1;
> ++    int j,k,kp1,l,nm1;
> +
> +     /* gaussian elimination with partial pivoting */
> +
> +--
> +2.34.1
> +
> diff --git a/meta-oe/recipes-benchmark/linpack/linpack_1.0.bb b/meta-oe/recipes-benchmark/linpack/linpack_1.0.bb
> index fe540749b5..735b5560e0 100644
> --- a/meta-oe/recipes-benchmark/linpack/linpack_1.0.bb
> +++ b/meta-oe/recipes-benchmark/linpack/linpack_1.0.bb
> @@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://${UNPACKDIR}/linpacknew.c;beginline=1;endline=23;md5=
>
>  SRC_URI = "http://www.netlib.org/benchmark/linpackc.new;downloadfilename=linpacknew.c \
>             file://0001-linpack-Define-DP-only-when-SP-is-not-defined.patch \
> +                  file://0001-Fix-build-error-in-gcc-15.0.1-due-to-function-redecl.patch \
>            "
>  SRC_URI[sha256sum] = "a63f2ec86512959f1fd926bfafb85905b2d7b7402942ffae3af374d48745e97e"
>
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#116466): https://lists.openembedded.org/g/openembedded-devel/message/116466
> Mute This Topic: https://lists.openembedded.org/mt/112020897/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta-oe/recipes-benchmark/linpack/linpack/0001-Fix-build-error-in-gcc-15.0.1-due-to-function-redecl.patch b/meta-oe/recipes-benchmark/linpack/linpack/0001-Fix-build-error-in-gcc-15.0.1-due-to-function-redecl.patch
new file mode 100644
index 0000000000..783a98f114
--- /dev/null
+++ b/meta-oe/recipes-benchmark/linpack/linpack/0001-Fix-build-error-in-gcc-15.0.1-due-to-function-redecl.patch
@@ -0,0 +1,55 @@ 
+From a1c1211fd6fc8d82053074c6dc531340f046c8d4 Mon Sep 17 00:00:00 2001
+From: "mark.yang" <mark.yang@lge.com>
+Date: Tue, 1 Apr 2025 16:06:56 +0900
+Subject: [PATCH] Fix build error in gcc 15.0.1 due to function redeclaration.
+
+Fix build error:
+linpacknew.c: In function 'dgefa':
+linpacknew.c:257:9: error: conflicting types for 'idamax'; have 'int(void)'
+  257 |     int idamax(),j,k,kp1,l,nm1;
+      |         ^~~~~~
+linpacknew.c:63:13: note: previous declaration of 'idamax' with type 'int(int,  REAL *, int)' {aka 'int(int,  double *, int)'}
+   63 | static int  idamax   (int n,REAL *dx,int incx);
+      |             ^~~~~~
+linpacknew.c:272:21: error: too many arguments to function 'idamax'; expected 0, have 3
+  272 |                 l = idamax(n-k,&a[lda*k+k],1) + k;
+      |                     ^~~~~~ ~~~
+linpacknew.c:257:9: note: declared here
+  257 |     int idamax(),j,k,kp1,l,nm1;
+      |         ^~~~~~
+linpacknew.c:326:21: error: too many arguments to function 'idamax'; expected 0, have 3
+  326 |                 l = idamax(n-k,&a[lda*k+k],1) + k;
+      |                     ^~~~~~ ~~~
+linpacknew.c:257:9: note: declared here
+  257 |     int idamax(),j,k,kp1,l,nm1;
+      |         ^~~~~~
+
+The function was already declared as static int idamax(int n, REAL *dx, int incx);
+on line 63, but it was redeclared as int idamax() inside the dgefa function on line 257,
+causing a conflict.
+where functions are redeclared without parameters,
+causing conflicts with the original function definitions.
+
+Signed-off-by: mark.yang <mark.yang@lge.com>
+
+Upstream-Status: Pending
+---
+ linpacknew.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/linpacknew.c b/linpacknew.c
+index c656082..5c8687b 100644
+--- a/linpacknew.c
++++ b/linpacknew.c
+@@ -254,7 +254,7 @@ static void dgefa(REAL *a,int lda,int n,int *ipvt,int *info,int roll)
+ 
+     {
+     REAL t;
+-    int idamax(),j,k,kp1,l,nm1;
++    int j,k,kp1,l,nm1;
+ 
+     /* gaussian elimination with partial pivoting */
+ 
+-- 
+2.34.1
+
diff --git a/meta-oe/recipes-benchmark/linpack/linpack_1.0.bb b/meta-oe/recipes-benchmark/linpack/linpack_1.0.bb
index fe540749b5..735b5560e0 100644
--- a/meta-oe/recipes-benchmark/linpack/linpack_1.0.bb
+++ b/meta-oe/recipes-benchmark/linpack/linpack_1.0.bb
@@ -6,6 +6,7 @@  LIC_FILES_CHKSUM = "file://${UNPACKDIR}/linpacknew.c;beginline=1;endline=23;md5=
 
 SRC_URI = "http://www.netlib.org/benchmark/linpackc.new;downloadfilename=linpacknew.c \
            file://0001-linpack-Define-DP-only-when-SP-is-not-defined.patch \
+		   file://0001-Fix-build-error-in-gcc-15.0.1-due-to-function-redecl.patch \
           "
 SRC_URI[sha256sum] = "a63f2ec86512959f1fd926bfafb85905b2d7b7402942ffae3af374d48745e97e"