This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/81508] Control reaches end of non-void function - warning not emmited when optimization is turned on


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81508

--- Comment #2 from Juraj Oršulić <juraj.orsulic at fer dot hr> ---
Apologies for the spam, I have now attached an even smaller minimal working
example (without the glog dependency), along with some useful info:

- when optimisation is enabled, GCC correctly uses __attribute__ ((noreturn))
to figure out that LogMessageFatal() will not return when invoked from Flush().
However, without optimisation, we get the aforementioned error.

- for some strange reason, if we remove the declaration of the string local
variable in Flush(), compilation without optimisation will also be successful.

This odd behaviour (especially the second one) suggests to me that this could
really be a gcc bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]