🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #771

aggregate/preprocessor bug

#771
From: Jeff Lewis
Date: Mon, 30 Oct 1989 19:55
19 lines
909 bytes
On compilation, the indicated line yields the error message:
too many (4) args to macro `ComplexAdd'

typedef struct { double r, i; } complex;

#define ComplexAdd(a, b) \
    ((complex) { a.r + b.r, a.i + b.i })

complex biff;

main()

{

    /* the following line with the extra ()'s works */
    biff = ComplexAdd(((complex) { 1, 2 }), ((complex) { 3, 4}));
    /* the following line yields the error message */
    biff = ComplexAdd((complex) { 1, 2 }, (complex) { 3, 4});
}
Technical Details
Message-ID: <8910301955.AA15338@rvl2.ecn.purdue.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!cs.utexas.edu!tut.cis.ohio-state.edu!RVL2.ECN.PURDUE.EDU!lewie

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!cs.utexas.edu!tut.cis.ohio-state.edu!RVL2.ECN.PURDUE.EDU!lewie
From: lewie@RVL2.ECN.PURDUE.EDU (Jeff Lewis)
Newsgroups: gnu.gcc.bug
Subject: aggregate/preprocessor bug
Message-ID: <8910301955.AA15338@rvl2.ecn.purdue.edu>
Date: 30 Oct 89 19:55:38 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 19