http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59922

            Bug ID: 59922
           Summary: -finstrument-functions emit false warning "control
                    reaches end of non-void function"
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alex at alemate dot ru

Example input:

---------- t.c ---------
int something();                                                                

int f(int arg) {                                                                
 return 0;                                                                      
 (void)(false ? 1 : something());                                               
}   
-----------------------

$ c++ -c t.cc -finstrument-functions -Wall -Werror
t.cc: In function ‘int f(int)’:
t.cc:6:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
$ echo $?
1
$

But:

$ c++ -c t.cc -Wall -Werror
$ echo $?
0
$

Reply via email to