I don't know if this is bug or enhancement. It seems there was an attempt to implement it, so I am marking it as a bug for now.
test.c:
__pragma(pack(push, 8))
----
dmd test.c
test.c(1): Error: found `8` when expecting `,`
test.c(1): Error: `=`, `;` or `,` expected to end declaration instead of `End of File`
Comment #1 by bugzilla — 2022-02-03T08:33:06Z
Where did you see it?
Comment #2 by maxsamukha — 2022-02-03T09:35:11Z
I meant specifically __pragma(pack). Having skimmed over https://github.com/dlang/dmd/pull/13112, I got the impression that __pragma(pack) was supported. I see now that the __pragma token is reserved, but only '#pragma pack' is recognized.
I was able to shut up the compiler with this hack (correctness of '#pragma pack' implementation is not immediately important to me):
#define PP_HASH #
#define PP_IDENTITY(value) value
#define __pragma(args) PP_IDENTITY(PP_HASH)pragma args
Comment #3 by maxsamukha — 2022-02-03T09:53:32Z
(In reply to Max Samukha from comment #2)
> I see now that the __pragma token is reserved,
That's wrong. __pragma is the identifier for the 'pragma' token. I should be more attentive.
Comment #4 by dlang-bot — 2022-06-25T04:26:17Z
@WalterBright created dlang/dmd pull request #14250 "fix Issue 22724 - ImportC: VC extension __pragma(pack) is not implemeā¦" fixing this issue:
- fix Issue 22724 - ImportC: VC extension __pragma(pack) is not implemented
https://github.com/dlang/dmd/pull/14250
Comment #5 by dlang-bot — 2022-06-25T06:40:08Z
dlang/dmd pull request #14250 "fix Issue 22724 - ImportC: VC extension __pragma(pack) is not implemeā¦" was merged into master:
- 0547bb1e6f09c1f1b1502ff83b8012d737abe09b by Walter Bright:
fix Issue 22724 - ImportC: VC extension __pragma(pack) is not implemented
https://github.com/dlang/dmd/pull/14250