Bug 25170 - Erroneous error message for simple macro
Summary: Erroneous error message for simple macro
Status: RESOLVED DUPLICATE of bug 7976
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.0.1
: P3 major
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-30 01:16 UTC by John Witford
Modified: 2005-11-30 01:33 UTC (History)
9 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Witford 2005-11-30 01:16:35 UTC
Here is the test code:

    typedef struct
    {
        int ele;
    } tstruct;

    #define TST(r,t) r##t = 1

    void test()
    {
        tstruct ts;

        TST(ts,.ele);
    }

It generates the error:

    "error: pasting "ts" and "." does not give a valid preprocessing token"

In previous versions of compiler (eg gcc-3.2.2) this generated a warning and could therefore be ignored as another piece of unhelpful compiler output.  But now it is a error (but it isn't!) which stops compilation.
Comment 1 Andrew Pinski 2005-11-30 01:33:33 UTC
This has been an error since 3.0.x.
And it is an error in your code.

*** This bug has been marked as a duplicate of 7976 ***