libMesh / libmesh

libMesh github repository
http://libmesh.github.io
GNU Lesser General Public License v2.1
659 stars 286 forks source link

Disable -Wimplicit-fallthrough warnings in FParser code #2613

Closed jwpeterson closed 4 years ago

jwpeterson commented 4 years ago

If I recall correctly, this is a GCC-only warning, but when compiling FParser code I see hundreds of lines of warnings:

./extrasrc/fp_opcode_add.inc:10662:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
  if(!ByteCodePtr)
  ^~

I don't propose trying to actually fix these, but maybe they could be disabled with compiler pragmas.

roystgnr commented 4 years ago

This is one of the ones our ignore_warnings.h disables, and the placement of the pragma there says it works for GCC 6 or later.

Of course that doesn't help fparser, which doesn't include any libMesh headers, but we could reasonably make a copy (ideally a stripped down copy, since ignore_warnings.h disables any warning that any third-party headers have ever given us) to use there.

jwpeterson commented 4 years ago

I'll try just copying the pragma and compiler version checks from ignore_warnings.h

jwpeterson commented 4 years ago

Fixed in #2617