GCC emits diagnostics for following...

$ cat a.c
int foo()
{

#ifdef FOO
        return 1;
#elif BAR FOO
        return 0;
#endif
}
$ cc a.c -c
a.c:6:11: error: missing binary operator before token "FOO"
$

However, it does not emit diagnostics for following ...

$ cat a.c
#define FOO 1
int foo()
{

#ifdef FOO
        return 1;
#elif BAR FOO
        return 0;
#endif
}

-- 
           Summary: #elif token1 token2 doesn't produce a diagnostic
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dpatel at apple dot com
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to