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.


-- 
           Summary: Erroneous error message for simple macro
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jw203198 at hotmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25170

Reply via email to