Preprocessor: Evaluate INT_MIN / -1 to 0.
This division is undefined behaviour which raises SIGFPE on x86. Most C++ preprocessors evaluate this silently to 0.
This commit is contained in:
14
Test/baseResults/cppIntMinOverNegativeOne.frag.out
Normal file
14
Test/baseResults/cppIntMinOverNegativeOne.frag.out
Normal file
@@ -0,0 +1,14 @@
|
||||
cppIntMinOverNegativeOne.frag
|
||||
Shader version: 100
|
||||
0:? Sequence
|
||||
0:? Linker Objects
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
|
||||
ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point
|
||||
|
||||
Shader version: 100
|
||||
0:? Sequence
|
||||
0:? Linker Objects
|
||||
|
||||
3
Test/cppIntMinOverNegativeOne.frag
Normal file
3
Test/cppIntMinOverNegativeOne.frag
Normal file
@@ -0,0 +1,3 @@
|
||||
#if (-2147483648 / -1) != 0
|
||||
#error INT_MIN / -1 should yield 0, something went wrong.
|
||||
#endif
|
||||
Reference in New Issue
Block a user