[LLVMbugs] [Bug 12515] New: clang rejects the code, bug gcc accepts it.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 9 23:09:54 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=12515

             Bug #: 12515
           Summary: clang rejects the code, bug gcc accepts it.
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: xu_zhong_xing at 163.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8364
  --> http://llvm.org/bugs/attachment.cgi?id=8364
The code that clang rejects.

chroot.c:103:44: error: type name requires a specifier or qualifier
        gids = ((void) (!!sizeof (struct { _Static_assert (sizeof *(gids) != 1,
"verify_true (" "sizeof *(gids) != 1" ")"); int _gl_dummy; })), x2nrealloc
(gids, &n_gids_allocated, sizeof *(gids)));
                                           ^
chroot.c:103:44: error: expected member name or ';' after declaration
specifiers
        gids = ((void) (!!sizeof (struct { _Static_assert (sizeof *(gids) != 1,
"verify_true (" "sizeof *(gids) != 1" ")"); int _gl_dummy; })), x2nrealloc
(gids, &n_gids_allocated, sizeof *(gids)));
                                           ^~~~~~~~~~~~~~
chroot.c:103:43: error: expected ';' at end of declaration list
        gids = ((void) (!!sizeof (struct { _Static_assert (sizeof *(gids) != 1,
"verify_true (" "sizeof *(gids) != 1" ")"); int _gl_dummy; })), x2nrealloc
(gids, &n_gids_allocated, sizeof *(gids)));
                                          ^

The source code is attached.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list