From 6ba6f4b4d651c1e3aff6946ef3c7a2f1b2c5d6d8 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 25 Feb 2013 03:43:01 +0100 Subject: [PATCH] build: turn on strict aliasing in release builds --- common.gypi | 10 ++++++++-- uv.gyp | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/common.gypi b/common.gypi index c3d9527cc..8c6c88758 100644 --- a/common.gypi +++ b/common.gypi @@ -45,7 +45,13 @@ }, 'Release': { 'defines': [ 'NDEBUG' ], - 'cflags': [ '-O3', '-fomit-frame-pointer', '-fdata-sections', '-ffunction-sections' ], + 'cflags': [ + '-O3', + '-fstrict-aliasing', + '-fomit-frame-pointer', + '-fdata-sections', + '-ffunction-sections', + ], 'msvs_settings': { 'VCCLCompilerTool': { 'target_conditions': [ @@ -163,7 +169,7 @@ 'PREBINDING': 'NO', # No -Wl,-prebind 'USE_HEADERMAP': 'NO', 'OTHER_CFLAGS': [ - '-fno-strict-aliasing', + '-fstrict-aliasing', ], 'WARNING_CFLAGS': [ '-Wall', diff --git a/uv.gyp b/uv.gyp index 075724dc5..e3443b26c 100644 --- a/uv.gyp +++ b/uv.gyp @@ -112,7 +112,8 @@ '-pedantic', '-Wall', '-Wextra', - '-Wno-unused-parameter' + '-Wstrict-aliasing', + '-Wno-unused-parameter', ], 'sources': [ 'include/uv-private/uv-unix.h',