This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81508] Control reaches end of non-void function - warning not emmited when optimization is turned on
- From: "juraj.orsulic at fer dot hr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 21 Jul 2017 16:44:22 +0000
- Subject: [Bug c++/81508] Control reaches end of non-void function - warning not emmited when optimization is turned on
- Auto-submitted: auto-generated
- References: <bug-81508-4@http.gcc.gnu.org/bugzilla/>
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.