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]

wrong warning w/ non-void functions


Hi,

IMHO, gcc/g++ should be able to find out by flow analysis
that a warning is not necessary in the following case:

enum ab {A, B};
int f(ab argument);

int
f(ab argument) {
    switch (argument) {
        case A:
            return 1;
        case B:
            return 2;
    }
}

Current versions of the compiler warn about
"control reaches end of non-void function `f(ab)'"
when compiling with -Wall.

If a warning is indeed desired in this case, it would be
nice to have an option to suppress it (if -Wall is specified).

Regards
-- 

Ingolf Koch         http://www.minet.uni-jena.de/~ingolf/ 
FSU Jena, Institut fuer Angewandte Mathematik, 07740 Jena


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