Path: utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!CAD.BERKELEY.EDU!island!orkney!derek From: island!orkney!derek@CAD.BERKELEY.EDU (Derek Clegg) Newsgroups: gnu.gcc.bug Subject: `gcc-cpp' fails to correctly warn about absent arguments in macros Message-ID: <8908241617.AA08847@orkney.island.uucp> Date: 24 Aug 89 16:17:47 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 28 /* Version: * GNU CPP version 1.35 * 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'" */ }