On Tue, Apr 11, 2017 at 11:40 AM, Bart Van Assche <bart.vanass...@gmail.com>
wrote:

> On Tue, Apr 11, 2017 at 8:27 AM, Bill Fenner <fen...@gmail.com> wrote:
> > Now I get a fair number of
> >
> > cc1: warning: unrecognized command line option
> "-Wno-implicit-fallthrough"
> >
> > Would it be better to try __attribute__((fallthrough))?  Or, only add
> the -W
> > flag if the compiler supports it?
>
> Hello Bill,
>
> That was unintended. I think this means that the following code in
> configure.d/config_os_progs needs to be improved:
>
>     netsnmp_save_CFLAGS="$CFLAGS"
>    for opt in \
>        -Wextra -Wno-unused-parameter -Wno-missing-field-initializers \
>        -Wno-type-limits -Wno-unused-result -Wno-sign-compare \
>        -Wno-implicit-fallthrough
>    do
>      AC_MSG_CHECKING([whether the compiler supports $opt])
>      CFLAGS="$opt $CFLAGS"
>      AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
>        AC_MSG_RESULT([yes])
>        DEVFLAGS="$DEVFLAGS $opt"
>      ], [
>        AC_MSG_RESULT([no])
>      ])
>      CFLAGS="$netsnmp_save_CFLAGS"
>    done
>
> Indeed.
[net-snmp] checking whether the compiler supports
-Wno-implicit-fallthrough... yes

What's weird is that the "I don't support -Wno-implicit-fallthrough"
warning only appears when the file being complied elicits some other
warning, so this method of checking for it won't help.  Maybe if we just
remove all the other warnings this will not be an issue ;-)

Since there's no obvious way to check whether or not the compiler
*actually* supports this warning flag, I'm fine leaving things as they are.

  Bill
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to