Thread overview | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 15, 2023 [Issue 23712] compilable/testcstuff1.c:98:1: error: static assertion failed: sizeof(9223372036854775808) == 8 | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23712 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |accepts-invalid, ImportC See Also| |https://issues.dlang.org/sh | |ow_bug.cgi?id=23689 Depends on| |23689 Referenced Issues: https://issues.dlang.org/show_bug.cgi?id=23689 [Issue 23689] ImportC: C tests in the testsuite are not valid C -- |
February 20, 2023 [Issue 23712] compilable/testcstuff1.c:98:1: error: static assertion failed: sizeof(9223372036854775808) == 8 | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23712 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla@digitalmars.com --- Comment #1 from Walter Bright <bugzilla@digitalmars.com> --- Shouldn't it be promoted to a long, rather than an unsigned? -- |
February 20, 2023 [Issue 23712] compilable/testcstuff1.c:98:1: error: static assertion failed: sizeof(9223372036854775808) == 8 | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23712 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ibuclaw@gdcproject.org --- Comment #2 from Iain Buclaw <ibuclaw@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. -- |
February 20, 2023 [Issue 23712] ImportC: Unclear documentation of what type is inferred from integer literals (type of '9223372036854775808' is undefined) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23712 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|compilable/testcstuff1.c:98 |ImportC: Unclear |:1: error: static assertion |documentation of what type |failed: |is inferred from integer |sizeof(9223372036854775808) |literals (type of |== 8 |'9223372036854775808' is | |undefined) -- |
February 20, 2023 [Issue 23712] ImportC: Unclear documentation of what type is inferred from integer literals (type of '9223372036854775808' is undefined) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23712 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|dmd |dlang.org -- |
February 20, 2023 [Issue 23712] ImportC: Unclear documentation of what type is inferred from integer literals (type of '9223372036854775808' is undefined) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23712 --- Comment #3 from Iain Buclaw <ibuclaw@gdcproject.org> --- (In reply to Iain Buclaw from comment #2) > Seems that it is undefined behaviour in C, as the test fails under gcc, but passes for clang. > > https://godbolt.org/z/3hnjzMhfM Note that both *do* give warnings about it though, to make it abundantly clear this is not strictly deterministic code. -- |
February 27, 2023 [Issue 23712] ImportC: Unclear documentation of what type is inferred from integer literals (type of '9223372036854775808' is undefined) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23712 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P1 |P2 -- |
November 27, 2023 [Issue 23712] ImportC: Unclear documentation of what type is inferred from integer literals (type of 9223372036854775808 is undefined) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23712 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|ImportC: Unclear |ImportC: Unclear |documentation of what type |documentation of what type |is inferred from integer |is inferred from integer |literals (type of |literals (type of |'9223372036854775808' is |9223372036854775808 is |undefined) |undefined) OS|Linux |All -- |
November 27, 2023 [Issue 23712] ImportC: Unclear documentation of what type is inferred from integer literals (type of 9223372036854775808 is undefined) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23712 Dlang Bot <dlang-bot@dlang.rocks> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull --- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> --- @WalterBright created dlang/dlang.org pull request #3730 "fix Issue 23712 - ImportC: Unclear documentation of what type is infe…" fixing this issue: - fix Issue 23712 - ImportC: Unclear documentation of what type is inferred from integer literals (type of 9223372036854775808 is undefined) https://github.com/dlang/dlang.org/pull/3730 -- |
November 27, 2023 [Issue 23712] ImportC: Unclear documentation of what type is inferred from integer literals (type of 9223372036854775808 is undefined) | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23712 Dlang Bot <dlang-bot@dlang.rocks> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> --- dlang/dlang.org pull request #3730 "fix Issue 23712 - ImportC: Unclear documentation of what type is infe…" was merged into master: - 9bca33d060e4fa48f6ec7381472801122d8202f6 by Walter Bright: fix Issue 23712 - ImportC: Unclear documentation of what type is inferred from integer literals (type of 9223372036854775808 is undefined) https://github.com/dlang/dlang.org/pull/3730 -- |
Copyright © 1999-2021 by the D Language Foundation