[cfe-dev] On preserving unused file-local definitions at -O0

David Blaikie dblaikie at gmail.com
Fri Apr 11 11:34:03 PDT 2014


On Fri, Apr 11, 2014 at 9:46 AM, Robinson, Paul
<Paul_Robinson at playstation.sony.com> wrote:
>> For Clang, run the GDB suite with -femit_all_decls ?
>> --paulr
>
> Speling it korecly, -femit-all-decls (duh).

Huh - I think I vaguely knew about that flag at some point & forgot
again (or never knew about it in the first place).

Neat-ish. Poor name of the flag (given it's about definitions, not
declarations).

Still want to try to get the GDB test suite clean with clang's default
configuration, ideally, one way or another. But actually the
difference in behavior between GCC's default and Clang's default or
Clang with -femit-all-decls is an interesting point. Clang either
emits 'everything' (unused static definitions and unused inline
definitions) or nothing. GCC is somewhere in the middle (emits unused
static definitions, but doesn't emit unused inline definitions) - so
perhaps that's a useful point to make to the GDB community that GCC
doesn't have a strong principle here... maybe. (I can see some
possible counterarguments already, though)

- David



More information about the cfe-dev mailing list