From: Bruno H. <br...@cl...> - 2017-03-11 02:04:27
|
Hi Sam, > >> > As I said on 2017-02-08, diagnostics from -Wshift-negative-value are > >> > most probably just noise. > >> > >> Why not disable them then? > > > > Feel free to do so. Good idea. > > Done. On OpenBSD 6, with gcc 4.2.1, I now get the build error: cc1: error: unrecognized command line option "-Wno-shift-negative-value" Please, can you limit the use of this option to the compilers that support it? Just tried it (I have all gcc releases installed separately): it's supported starting with gcc 4.4.0, unsupported for older versions. Using the same idiom that I used to protect the use of -Wno-invalid-offsetof: # g++ 3.4 introduced an annoying warning, but has a workaround: case "$XCC_GCC_VERSION" in 2.* | 3.[1-3]*) ;; *) XCFLAGS=$XCFLAGS' -Wno-invalid-offsetof' ;; esac Btw, why did you remove this version check? It is needed: $ /arch/x86-linux/gnu-inst-gcc/3.4.4/bin/gcc -x c++ -Wno-invalid-offsetof -S hello.c succeeds but $ /arch/x86-linux/gnu-inst-gcc/3.3.6/bin/gcc -x c++ -Wno-invalid-offsetof -S hello.c cc1plus: error: unrecognized option `-Wno-invalid-offsetof' I tend to assume a gcc version >= 3.1. Bruno |