Re: GNU make 3.81 with GCC 14
Lloyd Parkes <[email protected]> Mon, 09 Sep 2024 09:23:55 +1200
| Newsgroups | gmane.os.netbsd.devel.toolchain |
|---|---|
| Message-ID | <28303de39d13bc1110bac6523e1956f2f0e9099f.camel@must-have-coffee.gen.nz> |
Kia ora koutou,
Prompted by Greg's discussion of flags to adjust C compiler behaviour I
decided to see if the GCC 14 release notes had anything to say on this
matter.
And they do. The release notes link to
https://gcc.gnu.org/gcc-14/porting_to.html which says old code that
can't be fixed "can be compiled with -fpermissive, -std=gnu89, or -
std=c89".
I tried "-std=c89" because that looked like it would be more likely to
work on other compilers, but GNU make 3.81 uses extensions to the C
language. I tried "-std=gnu89" and that worked fine.
I've just looked through the tools Makefiles and I can see that we
already have a mechanism to detect GCC versions for this sort of job.
Does the following look like a good idea to add to
tools/gmake/Makefile? I can create a PR for it easily enough.
.if ${HAVE_GCC} > 13
HOST_CFLAGS+= -std=gnu89
.endif
Ngā mihi,
Lloyd