return lines in C headers throwing errors on make
by thethinker from LinuxQuestions.org on (#6H132)
So I'm having error compiling Code:arb (https://github.com/fredrik-johansson/arb) from source on AlmaLinux 9.3. The errors I'm getting are
Code:$ make
make[1]: Entering directory '/home/cduston/Downloads/arb-master'
make[2]: Entering directory '/home/cduston/Downloads/arb-master/fmpr'
CC ../build/fmpr/add.lo
In file included from /home/cduston/Downloads/arb-master/fmpr.h:22,
from add.c:12:
/usr/local/include/flint/flint.h:246:1: error: expected i;i before ivoidi
246 | void flint_randinit(flint_rand_t state)
| ^~~~
/usr/local/include/flint/flint.h:259:1: error: expected i;i before ivoidi
259 | void flint_randseed(flint_rand_t state, ulong seed1, ulong seed2)
| ^~~~
/usr/local/include/flint/flint.h:266:1: error: expected i;i before ivoidi
266 | void flint_get_randseed(ulong * seed1, ulong * seed2, flint_rand_t state)etc. The code makes it pretty clear what the problem is (flint is some new variation of arb...don't think that's relevant for this):
Code:$ sed -n '240,270p' /usr/local/include/flint/flint.h mp_limb_t __randval2;
} flint_rand_s;
typedef flint_rand_s flint_rand_t[1];
FLINT_INLINE
void flint_randinit(flint_rand_t state)
{
state->gmp_init = 0;
#if FLINT64
state->__randval = UWORD(13845646450878251009);
state->__randval2 = UWORD(13142370077570254774);
#else
state->__randval = UWORD(4187301858);
state->__randval2 = UWORD(3721271368);
#endif
}
FLINT_INLINE
void flint_randseed(flint_rand_t state, ulong seed1, ulong seed2)
{
state->__randval = seed1;
state->__randval2 = seed2;
}
FLINT_INLINE
void flint_get_randseed(ulong * seed1, ulong * seed2, flint_rand_t state)
{
*seed1 = state->__randval;
*seed2 = state->__randval2;
}So if this was my code, I would just delete those newlines before the void declarations, but there's no way this project is full of programmers as terrible as I am, so I'm sure there is something else going on. Maybe a different C standard or something? Don't actually know if this helps....
Code:$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-host-pie --enable-host-bind-now --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugs.almalinux.org/ --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-plugin --enable-initfini-array --without-isl --enable-multilib --with-linker-hash-style=gnu --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_64=x86-64-v2 --with-arch_32=x86-64 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.1 20230605 (Red Hat 11.4.1-2) (GCC)I can submit a bug report, but I assume these errors seem too purposeful to be actual bugs in the code - can anyone spot the stupid thing I'm doing?
Code:$ make
make[1]: Entering directory '/home/cduston/Downloads/arb-master'
make[2]: Entering directory '/home/cduston/Downloads/arb-master/fmpr'
CC ../build/fmpr/add.lo
In file included from /home/cduston/Downloads/arb-master/fmpr.h:22,
from add.c:12:
/usr/local/include/flint/flint.h:246:1: error: expected i;i before ivoidi
246 | void flint_randinit(flint_rand_t state)
| ^~~~
/usr/local/include/flint/flint.h:259:1: error: expected i;i before ivoidi
259 | void flint_randseed(flint_rand_t state, ulong seed1, ulong seed2)
| ^~~~
/usr/local/include/flint/flint.h:266:1: error: expected i;i before ivoidi
266 | void flint_get_randseed(ulong * seed1, ulong * seed2, flint_rand_t state)etc. The code makes it pretty clear what the problem is (flint is some new variation of arb...don't think that's relevant for this):
Code:$ sed -n '240,270p' /usr/local/include/flint/flint.h mp_limb_t __randval2;
} flint_rand_s;
typedef flint_rand_s flint_rand_t[1];
FLINT_INLINE
void flint_randinit(flint_rand_t state)
{
state->gmp_init = 0;
#if FLINT64
state->__randval = UWORD(13845646450878251009);
state->__randval2 = UWORD(13142370077570254774);
#else
state->__randval = UWORD(4187301858);
state->__randval2 = UWORD(3721271368);
#endif
}
FLINT_INLINE
void flint_randseed(flint_rand_t state, ulong seed1, ulong seed2)
{
state->__randval = seed1;
state->__randval2 = seed2;
}
FLINT_INLINE
void flint_get_randseed(ulong * seed1, ulong * seed2, flint_rand_t state)
{
*seed1 = state->__randval;
*seed2 = state->__randval2;
}So if this was my code, I would just delete those newlines before the void declarations, but there's no way this project is full of programmers as terrible as I am, so I'm sure there is something else going on. Maybe a different C standard or something? Don't actually know if this helps....
Code:$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-host-pie --enable-host-bind-now --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugs.almalinux.org/ --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-plugin --enable-initfini-array --without-isl --enable-multilib --with-linker-hash-style=gnu --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_64=x86-64-v2 --with-arch_32=x86-64 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.1 20230605 (Red Hat 11.4.1-2) (GCC)I can submit a bug report, but I assume these errors seem too purposeful to be actual bugs in the code - can anyone spot the stupid thing I'm doing?