summaryrefslogtreecommitdiff
path: root/compileoptions.cmake
diff options
context:
space:
mode:
authorAditya Mandaleeka <adityamandaleeka@users.noreply.github.com>2016-05-04 18:50:00 -0700
committerAditya Mandaleeka <adityamandaleeka@users.noreply.github.com>2016-05-04 18:50:00 -0700
commitdc71a169507810c1dafad6fa20dc3881c6e4d4ec (patch)
tree531501aa10e48cbbcfb02c082a92bc401704f02b /compileoptions.cmake
parentb889f007480b6818a5cb144e726d3e2940fd5cd3 (diff)
parente67df67213d1b4730d5d2c803c681bc55f009792 (diff)
downloadcoreclr-dc71a169507810c1dafad6fa20dc3881c6e4d4ec.tar.gz
coreclr-dc71a169507810c1dafad6fa20dc3881c6e4d4ec.tar.bz2
coreclr-dc71a169507810c1dafad6fa20dc3881c6e4d4ec.zip
Merge pull request #4765 from adityamandaleeka/array_alloc_bounds_check
Add fwrapv compile option
Diffstat (limited to 'compileoptions.cmake')
-rw-r--r--compileoptions.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/compileoptions.cmake b/compileoptions.cmake
index bda438e050..9fcbb741d0 100644
--- a/compileoptions.cmake
+++ b/compileoptions.cmake
@@ -7,6 +7,10 @@ if (CLR_CMAKE_PLATFORM_UNIX)
#-fms-compatibility Enable full Microsoft Visual C++ compatibility
#-fms-extensions Accept some non-standard constructs supported by the Microsoft compiler
+ # Make signed arithmetic overflow of addition, subtraction, and multiplication wrap around
+ # using twos-complement representation (this is normally undefined according to the C++ spec).
+ add_compile_options(-fwrapv)
+
if(CLR_CMAKE_PLATFORM_DARWIN)
# We cannot enable "stack-protector-strong" on OS X due to a bug in clang compiler (current version 7.0.2)
add_compile_options(-fstack-protector)