-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cast necessary after integer promotion sometimes omitted #3
Comments
Another example:
In C this evaluates to -2147483648 on x86/x86_86-linux, but fbfrog translates to
which is -2147483648 on x86 but 2147483648 on x86_64; the type is integer in both cases. |
…promotion sometimes omitted"
Looks like the typedef cast is what breaks it, this seems to work:
|
TODO: need to check whether all changes are OK/acceptable, but might be too much to permanently solve out known typedefs from expressions. (not wrong, but maybe unnecessarily different from the original header) Fixes: #3
Potential fix in fe043a7, but there are some side-effects which might require some testing with real bindings first. Also I'm pretty sure there are more missing cases, so if there's anything easy & obvious, it can probably be fixed aswell. |
(which has value 4294967295 on both x86-linux and x86_64-linux)
is translated by fbfrog (latest git head) to
which has value 4294967295 on x86-linux and 18446744073709551615 on x86_64-linux.
On the other hand
translates to
which has the correct value, 4294967295, on x86 and x86_64.
The double casts are necessary to paper over the difference in integer promotion rules between FB and C (which promote to
integer
andint
respectively).The text was updated successfully, but these errors were encountered: