Small warning during compile

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Small warning during compile

Rik-4
I'm getting this new warning during compilation:

libinterp/parse-tree/lex.cc:16:32: warning: unknown option after ‘#pragma
GCC diagnostic’ kind [-Wpragmas]

The line itself is

#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"

I suppose my gcc version, 5.4.0, is too old to recognize this particular
warning ID.

We can simply live with it, or maybe this particular pragma needs to be
protected with and ifdef depending on whether the compiler has this
warning.  It wouldn't be that hard to put in a test in configure.ac to set
an appropriate #define definition.

--Rik


Reply | Threaded
Open this post in threaded view
|

Re: Small warning during compile

Mike Miller-4
On Fri, Sep 29, 2017 at 13:45:52 -0700, Rik wrote:

> I'm getting this new warning during compilation:
>
> libinterp/parse-tree/lex.cc:16:32: warning: unknown option after ‘#pragma
> GCC diagnostic’ kind [-Wpragmas]
>
> The line itself is
>
> #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
>
> I suppose my gcc version, 5.4.0, is too old to recognize this particular
> warning ID.
>
> We can simply live with it, or maybe this particular pragma needs to be
> protected with and ifdef depending on whether the compiler has this
> warning.  It wouldn't be that hard to put in a test in configure.ac to set
> an appropriate #define definition.
If we decide to handle this warning, I also see a similar warning
building with clang 4.0

  libinterp/parse-tree/lex.cc:15:32: warning: unknown warning group '-Wzero-as-null-pointer-constant', ignored [-Wunknown-pragmas]
  #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
                                 ^

We already do test in configure whether certain warning flags are
accepted by the compiler. We could additionally define HAVE_WARNING_FOO
macros for each warning option to use as conditions where needed in the
code.

--
mike

signature.asc (849 bytes) Download Attachment