https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80458
--- Comment #4 from Ulya <skvadrik at gmail dot com> --- That sounds reasonable, however if I comment out 'if (!p) exit(1);', I get warning no matter inline or not: $ cat 1.cc #include <stdlib.h> // exit extern void *f(); inline void *g() { void *p = f(); // if (!p) exit(1); } skvadrik@skvadr_home ~ $ g++ -c -Wall -Wextra -O2 1.cc 1.cc: In function ‘void* g()’: 1.cc:4:11: warning: unused variable ‘p’ [-Wunused-variable] void *p = f(); ^ 1.cc:6:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^