[Bug c++/53370] New: Unbalanced parenthesis when using __attribute__

matias.fontanini at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed May 16 03:06:00 GMT 2012


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

             Bug #: 53370
           Summary: Unbalanced parenthesis when using __attribute__
    Classification: Unclassified
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: matias.fontanini@gmail.com


When using __attribute__((packed(N))), an unbalanced amount of parenthesis can
be used and no compilation error is detected. The documentation states:

"Note that __attribute__ spelled with two underscores before and two after, and
there are always two sets of parentheses surrounding the contents."

So this looks like a bug. To reproduce this error, compile this:

int main() {
    __attribute__((aligned(16)) char arr[5];
}

Which contains three '(' and two ')' and still compiles. Note that gcc does
detect this error, g++ does not.



More information about the Gcc-bugs mailing list