diff options
author | Manuel Bergler <berglerma@gmail.com> | 2025-05-26 19:53:45 +0200 |
---|---|---|
committer | Chris Packham <judge.packham@gmail.com> | 2025-05-29 08:38:12 +1200 |
commit | dba47c8dbceedb096860add1a442660c3c0522da (patch) | |
tree | e41684eebae9148198e7e1185bb49413d12595e0 | |
parent | 9a4a376bfb34e542003ca87008fc13f92fd9ead8 (diff) | |
download | crosstool-ng-dba47c8dbceedb096860add1a442660c3c0522da.tar.gz crosstool-ng-dba47c8dbceedb096860add1a442660c3c0522da.tar.bz2 crosstool-ng-dba47c8dbceedb096860add1a442660c3c0522da.zip |
gmp: Fix C23 compatibility patch to work with older host compilers
The patch added in 1e9bf8151513b054f60f34bc89507c31dc242cf0 changes
the definition of the function `g` used in `configure` tests from
`void g(){}` to `void g(int,t1 const*,t1,t2,t1 const*,int){}`.
However, omitting parameter names in function definitions is a C23 feature.
This thus causes configuration to fail with a GCC 9 host compiler:
```c
conftest.c: In function 'g':
conftest.c:7:8: error: parameter name omitted
7 | void g(int,t1 const*,t1,t2,t1 const*,int){}
| ^~~
conftest.c:7:12: error: parameter name omitted
7 | void g(int,t1 const*,t1,t2,t1 const*,int){}
| ^~~~~~~~~
conftest.c:7:22: error: parameter name omitted
7 | void g(int,t1 const*,t1,t2,t1 const*,int){}
| ^~
conftest.c:7:25: error: parameter name omitted
7 | void g(int,t1 const*,t1,t2,t1 const*,int){}
| ^~
conftest.c:7:28: error: parameter name omitted
7 | void g(int,t1 const*,t1,t2,t1 const*,int){}
| ^~~~~~~~~
conftest.c:7:38: error: parameter name omitted
7 | void g(int,t1 const*,t1,t2,t1 const*,int){}
Signed-off-by: Manuel Bergler <berglerma@gmail.com>
-rw-r--r-- | packages/gmp/6.3.0/0000-Complete-function-prototype-in-acinclude.patch | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/gmp/6.3.0/0000-Complete-function-prototype-in-acinclude.patch b/packages/gmp/6.3.0/0000-Complete-function-prototype-in-acinclude.patch index 55efaca2..d61285d7 100644 --- a/packages/gmp/6.3.0/0000-Complete-function-prototype-in-acinclude.patch +++ b/packages/gmp/6.3.0/0000-Complete-function-prototype-in-acinclude.patch @@ -14,7 +14,7 @@ Subject: [PATCH] Complete function prototype in acinclude.m4 for C23 #if defined (__GNUC__) && ! defined (__cplusplus) typedef unsigned long long t1;typedef t1*t2; -void g(){} -+void g(int,t1 const*,t1,t2,t1 const*,int){} ++void g(int p1,t1 const* p2,t1 p3,t2 p4,t1 const* p5,int p6){} void h(){} static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0) {t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;} @@ -25,7 +25,7 @@ Subject: [PATCH] Complete function prototype in acinclude.m4 for C23 #if defined (__GNUC__) && ! defined (__cplusplus) typedef unsigned long long t1;typedef t1*t2; -void g(){} -+void g(int,t1 const*,t1,t2,t1 const*,int){} ++void g(int p1,t1 const* p2,t1 p3,t2 p4,t1 const* p5,int p6){} void h(){} static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0) {t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;} |