Comments (2)
Possibly relevant:
void foo(void) {
unsigned __int128 x = ((unsigned __int128)18446744073709551615UL)<< 64;
}
test.c:2:70: warning: overflow in expression; result is '-18446744073709551616' [-Winteger-overflow]
unsigned __int128 x = ((unsigned __int128)18446744073709551615UL)<< 64;
^
1 warning generated.
(no diagnostics on clang)
from arocc.
Bug is in Type.signedness
:
diff --git a/src/aro/Type.zig b/src/aro/Type.zig
index 7e691bc..1369d7b 100644
--- a/src/aro/Type.zig
+++ b/src/aro/Type.zig
@@ -609,7 +609,7 @@ pub fn signedness(ty: Type, comp: *const Compilation) std.builtin.Signedness {
return switch (ty.specifier) {
// zig fmt: off
.char, .complex_char => return comp.getCharSignedness(),
- .uchar, .ushort, .uint, .ulong, .ulong_long, .bool, .complex_uchar, .complex_ushort,
+ .uchar, .ushort, .uint, .ulong, .ulong_long, .uint128, .bool, .complex_uchar, .complex_ushort,
.complex_uint, .complex_ulong, .complex_ulong_long, .complex_uint128 => .unsigned,
// zig fmt: on
.bit_int, .complex_bit_int => ty.data.int.signedness,
from arocc.
Related Issues (20)
- Crash: record with oversize array HOT 1
- Crash: assign to pointer to incomplete enum
- Enums types with fixed underlying type should compare equal to underlying type
- Fixed-underlying-type enums should enforce non-enum integral underlying type
- Crash: non-evaluated floating point comparison in boolean `or`
- Preprocessor allows extraneous tokens in preprocessor expression
- Integer literal promotion rules should emulate chosen compiler
- Incorrect sizeof for typeof incomplete array HOT 1
- Memory leak in preprocessor - indirect invocation of macro with incorrect number of arguments
- Print _BitInt size in diagnostics
- Warn if implicit integer conversion truncates value HOT 1
- Crash: redefining variable as `__auto_type` and assigning to self
- Crash: array subscript with string
- Crash: initializing pointer to typeof-invalid
- `__TIMESTAMP__` macro has incorrect value
- Aro's generated modules have generic names that flow to consuming projects HOT 2
- Support MSVC `__pragma`
- Support common linker flags
- Define __STDC_EMBED macros
- Remove calls to `std.meta.fields`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arocc.