[Issue 23509] New: ImportC: Unable to parse GLibC assert.h's assert (and other nontrivial macros?)
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Nov 26 07:50:08 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23509
Issue ID: 23509
Summary: ImportC: Unable to parse GLibC assert.h's assert (and
other nontrivial macros?)
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: kipthemudkip at yahoo.com
Just tried building the Mosquitto MQTT library (specifically just the client
library) on Artix Linux x64 solely with DMD master. I tried the following:
cd lib
dmd-master -P=-I../ -P=-I../deps *.c
...and got some errors on every mention of assert(). Try just one file to see
what I mean:
dmd-master -P=-I../ -P=-I../deps messages_mosq.c
messages_mosq.c(52): Error: expression expected, not `{`
messages_mosq.c(52): Error: found `if` when expecting `)`
messages_mosq.c(52): Error: found `;` when expecting `)`
messages_mosq.c(52): Error: found `else` when expecting `;` following statement
messages_mosq.c(52): Error: no type for declarator before `)`
messages_mosq.c(54): Error: no type for declarator before `for`
messages_mosq.c(54): Error: no type for declarator before `(`
messages_mosq.c(54): Error: no type for declarator before `(`
messages_mosq.c(56): Error: no type-specifier for declarator
messages_mosq.c(56): Error: found `;` when expecting `)`
messages_mosq.c(57): Error: `=`, `;` or `,` expected to end declaration instead
of `}`
messages_mosq.c(58): Error: no type for declarator before `(`
messages_mosq.c(58): Error: no type for declarator before `(`
messages_mosq.c(60): Error: no type-specifier for declarator
messages_mosq.c(60): Error: found `;` when expecting `)`
messages_mosq.c(61): Error: `=`, `;` or `,` expected to end declaration instead
of `}`
messages_mosq.c(68): Error: no type-specifier for declarator
messages_mosq.c(69): Error: no type-specifier for declarator
messages_mosq.c(70): Error: no type for declarator before `if`
messages_mosq.c(71): Error: no type-specifier for declarator
If I comment out all uses of assert() (including in deps/utlist.h), I get
similar errors from the use of the DL_DELETE macro in deps/utlist.h:
messages_mosq.c(154): Error: found `else` when expecting `while`
messages_mosq.c(154): Error: found `{` when expecting `(`
messages_mosq.c(157): Error: found `;` when expecting `)`
messages_mosq.c(158): Error: found `}` when expecting `;` following terminating
`;` required after do-while statement
messages_mosq.c(193): Error: `=`, `;` or `,` expected to end declaration
instead of `{`
messages_mosq.c(246): Error: found `}` when expecting `while`
messages_mosq.c(247): Error: found `;` when expecting `(`
messages_mosq.c(248): Error: expression expected, not `if`
messages_mosq.c(248): Error: found `{` when expecting `)`
messages_mosq.c(249): Error: found `return` when expecting `;` following
terminating `;` required after do-while statement
messages_mosq.c(249): Error: type-specifier missing for declaration of
`MOSQ_ERR_SUCCESS`
messages_mosq.c(253): Error: found `else` without a corresponding `if`
statement
messages_mosq.c(267): Error: found `}` when expecting `while`
messages_mosq.c(269): Error: found `;` when expecting `(`
messages_mosq.c(270): Error: expression expected, not `if`
messages_mosq.c(270): Error: found `{` when expecting `)`
messages_mosq.c(271): Error: found `return` when expecting `;` following
terminating `;` required after do-while statement
messages_mosq.c(271): Error: type-specifier missing for declaration of
`MOSQ_ERR_SUCCESS`
messages_mosq.c(279): Error: `=`, `;` or `,` expected to end declaration
instead of `{`
Wondering what the deal is here...
--
More information about the Digitalmars-d-bugs
mailing list