🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #545

`gcc-cpp' fails to correctly warn about absent arguments in macros

#545
From: Derek Clegg
Date: Thu, 24 Aug 1989 16:17
28 lines
1238 bytes
/* 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'" */
}
Technical Details
Message-ID: <8908241617.AA08847@orkney.island.uucp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!CAD.BERKELEY.EDU!island!orkney!derek

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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