Skip to content

configurator: regression in handling expressions for C imports #1720

@avsm

Description

@avsm

The fix for importing negative numbers in header files (#1334) added a dependency on the expression passed in also working with cpp. This prevents expressions such as sizeof(char) from being evaluated, as it leads to this error:

 | <...>/test.c:27:5: error: function-like macro 'sizeof' is not defined
 | #if sizeof(char) >= 0
 |     ^
 | 1 error generated.

I'm not sure what the best way to handle this is without knowing ahead of time if the value is possibly signed or not. We could distinguish C_define.Type to have a Uint that will not need the preprocess change above...

(This issue comes up when porting ctypes to dune)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions