ImportC and #pragma pack

Walter Bright newshound2 at digitalmars.com
Thu Sep 30 00:53:27 UTC 2021


On 9/29/2021 1:21 PM, Steven Schveighoffer wrote:
> Might I suggest -- you are going to have to preprocess the file anyway. If you 
> filter the preprocessor results through another processor that "fixes" these 
> things (like changes #pragma pack into D `align` directives), then you have room 
> to deal with nutburgers.

It's not the implementation difficulty, it's more the opening of "support every 
extension every C compiler ever added" kind of thing.

Besides, the #pragma pack is never properly documented. For example,

     struct S
     #pragma pack(1)
     { ...
     #pragma pack()
       ...
     };

supposed to do? It wretchedly mixes up the preprocessor and the core language 
syntax in a completely undocumented manner (and they're supposed to be separate 
languages).


More information about the Digitalmars-d mailing list