[Issue 23712] compilable/testcstuff1.c:98:1: error: static assertion failed: sizeof(9223372036854775808) == 8

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 20 11:54:32 UTC 2023


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

Iain Buclaw <ibuclaw at gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw at gdcproject.org

--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to Walter Bright from comment #1)
> Shouldn't it be promoted to a long, rather than an unsigned?
That is certainly what our parser does as this is how D works.

Seems that it is undefined behaviour in C, as the test fails under gcc, but
passes for clang.

https://godbolt.org/z/3hnjzMhfM

Should we add a `u` suffix to that literal? Probably, as I'm not comfortable us
testing undefined behaviour in the testsuite - even though it is *precisely
defined* for us in the D parser.

Maybe just document that we have a deterministic way of interpreting ambiguous
integer literals in ImportC and be done with it.

--


More information about the Digitalmars-d-bugs mailing list