Bug 23547 – [REG 2.101-master] C header files have precedent over D modules in imports

Status
NEW
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-12-10T14:45:53Z
Last change time
2024-12-13T19:26:19Z
Keywords
ImportC, rejects-valid, wrong-code
Assigned to
No Owner
Creator
Iain Buclaw
See also
https://issues.dlang.org/show_bug.cgi?id=23548
Moved to GitHub: dmd#18142 →

Comments

Comment #0 by ibuclaw — 2022-12-10T14:45:53Z
This test fails. $ dmd -I=imports importd.d importd.d(2): Error: undefined identifier `Have_Qsort_R` importd.d(2): while evaluating: `static assert(Have_Qsort_R)` importd.d ``` import gcc.config; static assert(Have_Qsort_R); ``` imports/gcc/config.d ``` module gcc.config; enum Have_Qsort_R = true; ``` gcc/config.h ``` #ifndef GCC_CONFIG_H #define GCC_CONFIG_H #ifdef GENERATOR_FILE #error config.h is for the host, not build, machine. #endif #ifdef IN_GCC # include "ansidecl.h" #endif #endif /* GCC_CONFIG_H */ ```
Comment #1 by ibuclaw — 2022-12-10T14:49:51Z
Caused by fix for issue 23479
Comment #2 by ibuclaw — 2022-12-10T14:50:15Z
Comment #3 by ibuclaw — 2022-12-30T23:38:56Z
*** Issue 23548 has been marked as a duplicate of this issue. ***
Comment #4 by bugzilla — 2023-01-10T06:07:36Z
The config.h file is found first because config.h appears before config.d in the import search path. If config.h and config.d were in the same directory, the .d file would take precedence.
Comment #5 by robert.schadek — 2024-12-13T19:26:19Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18142 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB