[gnu.gcc.bug] `gcc-cpp' fails to correctly warn about absent arguments in macros

derek@CAD.BERKELEY.EDU (Derek Clegg) (08/24/89)

/* Version:
 *     GNU CPP version 1.35
 * File:
 *     <this file>
 * Compile with:
 *     gcc-cpp -v [this file] > /dev/null
 * Problem:
 *     `gcc-cpp' fails to correctly warn about absent arguments in macros.
 * Output:
 *     GNU CPP version 1.35
 *     [this file]:27: only 1 args to macro `m2'
 * Notes:
 *     This behavior may be correct and my understanding of the C
 *     preprocessor flawed.
 *     gcc-cpp was compiled with `config.gcc sun3-os4'.
 *     I am using a Sun 3/60 with UNIX 4.2 (Sun release 4.0.1).
 *
 *		Derek B Clegg ({uunet,ucbcad,sun}!island!derek)
 */

#define m1(x)
#define m2(x,y)

foo()
{
    m1();   /* No warning, though we expect "too few (0) args to macro `m1'" */
    m2();   /* Incorrect warning: "only 1 args to macro `m2'" */
}