sha1collisiondetection icon indicating copy to clipboard operation
sha1collisiondetection copied to clipboard

Don't use gcc-specific compilerflags if not using gcc

Open MrShark opened this issue 6 years ago • 4 comments

Makes compilation using xlc on AIX (and likely other compilers) not warn so much.

MrShark avatar May 09 '18 13:05 MrShark

Hi @MrShark, thanks for looking at this.

If you check the build logs for your job, you can see that the command line parameters for both clang and gcc are only "-Ilib" dropping the "-O2 -Wall -Werror -Wextra -pedantic -std=c90" So I think that the logic you put in to check for gcc is incorrect.

Also, I don't think that checking for gcc only is what we want, as we want to support compiling with clang, which matches all the gcc parameters.

shumow avatar May 12 '18 01:05 shumow

Ahh, sorry. I only checked this patch on AIX. I will have a look att it (and also try to fix some other gnu-isms I found in make clean)

MrShark avatar May 14 '18 08:05 MrShark

Since a lot of common compilers allow for these gnu-isms, can you make it check for the specific non-supporting compiler?

BTW Which of the compiler options specifically cause issues? E.g., -Ilib, -O2 and -std=c90 are more important than -W* and -pedantic.

cr-marcstevens avatar May 14 '18 09:05 cr-marcstevens

A new patch: 4b0064d5abb218f2fa3b2282fb0ce4bed1749a1e

gmake apperently sets CC to cc by default, making the detection code from the manual void :-(

Well, well I added code to detect if gcc or clang is installed and then if $CC is cc use them, currently preferring clang if both are installed. This approach messes up if you have an other compiler installed as cc without an alias alongside gcc/clang and want to use cc for compilation (but probably not worse then before).

MrShark avatar May 14 '18 09:05 MrShark

Cleaning up among my old pull requests, I no longer have access to AIX systems to test this out on.

MrShark avatar Jul 23 '24 08:07 MrShark