[Issue 22598] New: importC: Add support for __extension__ keyword

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 14 10:36:16 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22598

          Issue ID: 22598
           Summary: importC: Add support for __extension__ keyword
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

In common system headers, the __extension__ keyword can crop up, i.e in
assert.h, assert() is defined as:

---
#  define assert(expr)                                                  \
  ((void) sizeof ((expr) ? 1 : 0), __extension__ ({                     \
      if (expr)                                                         \
        ; /* empty */                                                   \
      else                                                              \
        __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION);   \
    }))
---


Here the __extension__ disables any ISO C warnings caused by the non-standards
conforming syntax ({ ... }).

By not allowing the same to be compilable by ImportC would prevent any code
that uses assert.h from working.

--


More information about the Digitalmars-d-bugs mailing list