[Issue 24127] ImportC - no way to organize files

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 20 04:42:04 UTC 2023


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

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com

--- Comment #1 from Walter Bright <bugzilla at digitalmars.com> ---
The exact same thing happens when cstuff.c is actually named cstuff.d. But,
when:

    module foo.bar.cstuff;

is added to cstuff.d, it compiles without error.

The trouble is, when a module statement is not present, the compiler names the
module as if:

    module <filename>;

was present. <filename> is `cstuff`. The compiler does the same thing for .c
files - it assigns a module name of `cstuff`, not `foo.bar.cstuff`.

This boils down to the fact that C files do not have a means to name the
module. I think we're kinda stuck here.

--


More information about the Digitalmars-d-bugs mailing list