-
Notifications
You must be signed in to change notification settings - Fork 150
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
testcase generate with csmith --float warning: implicit conversion of out of range value from 'double' to 'uint32_t' (aka 'unsigned int') is undefined #132
Comments
Csmith is by design liberal when converting between scalar types. Many times the compilers treat the code in the same way even though the code might be Do you see the test case produces different results when compiled by different compilers? If so that becomes a valid bug. |
I will take several days to check whether this compiler warning causes different compilers or different compiler options to run differently. |
/*
* This is a RANDOMLY GENERATED PROGRAM.
*
* Generator: csmith 2.4.0
* Git version: deddca6
* Options: --float -o test.c
* Seed: 2256145340
*/
|
/*
* This is a RANDOMLY GENERATED PROGRAM.
*
* Generator: csmith 2.4.0
* Git version: deddca6
* Options: --float -o test.c
* Seed: 3731180208
*/
|
@yansendao Thanks for reporting the issue. It's known that passing
So, please don't use this option if you want to generate UB-free programs. I should've added some notes in the corresponding help message. On the other hand, you might want to try |
|
test command
result
test.c:43:13: warning: implicit conversion of out of range value from 'double' to 'uint32_t' (aka 'unsigned int') is undefined [-Wliteral-conversion]
csmith version:
test.zip
The text was updated successfully, but these errors were encountered: