Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enum __attribute__((packed)) causes assert failure #350

Open
denizzzka opened this issue Jun 26, 2024 · 1 comment
Open

enum __attribute__((packed)) causes assert failure #350

denizzzka opened this issue Jun 26, 2024 · 1 comment

Comments

@denizzzka
Copy link

C header:

enum esp_chip_id_t {
    ESP_CHIP_ID_ESP32 = 0x0000,
    ESP_CHIP_ID_INVALID = 0xFFFF
} __attribute__((packed));

Causes

Fatal error: core.exception.AssertError@../../.dub/packages/libclang/0.3.3/libclang/source/clang/package.d(290): Assertion failure
----------------
??:? [0x55fab4d53e6e]
??:? [0x55fab4d53ad2]
??:? [0x55fab4d7b25e]
??:? [0x55fab4d5be6f]
??:? [0x55fab4d52ba2]
../../.dub/packages/libclang/0.3.3/libclang/source/clang/package.d:290 [0x55fab4d1b198]
source/dpp/translation/aggregate.d:742 [0x55fab4c8c2dc]
/home/denizzz/ldc2_standalone/bin/../import/std/algorithm/iteration.d:582 [0x55fab4c8c36c]
/home/denizzz/ldc2_standalone/bin/../import/std/algorithm/searching.d:1321 [0x55fab4d0968f]
/home/denizzz/ldc2_standalone/bin/../import/std/algorithm/searching.d:3744 [0x55fab4c59907]
source/dpp/translation/aggregate.d:744 [0x55fab4c5688c]
source/dpp/translation/aggregate.d:190 [0x55fab4c55522]
source/dpp/translation/aggregate.d:159 [0x55fab4c560ef]
source/dpp/translation/aggregate.d:145 [0x55fab4c3f03f]
source/dpp/translation/translation.d:101 [0x55fab4c336d0]
source/dpp/translation/translation.d:23 [0x55fab4c3d9e4]
source/dpp/expansion/package.d:48 [0x55fab4cd4d28]
source/dpp/runtime/app.d:205 [0x55fab4c72ed3]
source/dpp/runtime/app.d:127 [0x55fab4cd2e38]
source/dpp/runtime/app.d:19 [0x55fab4c3282f]
source/main.d:9 [0x55fab4c320c2]
??:? [0x55fab4d5bb4c]
??:? [0x55fab4d5ba46]
??:? [0x55fab4d5b89c]
/home/denizzz/ldc2_standalone/bin/../import/core/internal/entrypoint.d:42 [0x55fab4c32b31]
??:? [0x7fde58918c89]
??:? __libc_start_main [0x7fde58918d44]
??:? [0x55fab4c31f80]
@denizzzka
Copy link
Author

(Yes, this is not from C standart, but widely used)

@denizzzka denizzzka changed the title enum __attribute__((packed)) causes failure enum __attribute__((packed)) causes assert failure Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant