Bug 1203005 - Remove all traces of -Wdeclaration-after-statement. r=glandium.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 09 Sep 2015 04:57:44 -0700
changeset 261574 1221862c641269071dec53d0867102eda84cc111
parent 261573 93ffb8305933e2aed8046a45286807a35edae09d
child 261575 0591a9b6e4a0ff333be4cf67fff34700f4c5ca5c
push id29348
push userkwierso@gmail.com
push dateWed, 09 Sep 2015 20:47:39 +0000
treeherdermozilla-central@dd2a1d737a64 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1203005
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1203005 - Remove all traces of -Wdeclaration-after-statement. r=glandium. Even though we compile C code as C99, we used to need -Wdeclaration-after-statement because MSVC didn't allow declarations after statements. However, Visual Studio 2013 added support, so we can now merrily mix declarations and statements everywhere. Hooray.
configure.in
js/src/configure.in
media/libcubeb/src/moz.build
media/libopus/moz.build
media/libstagefright/moz.build
media/pocketsphinx/moz.build
--- a/configure.in
+++ b/configure.in
@@ -1478,17 +1478,16 @@ if test "$GNU_CC"; then
     fi
 
     # Turn on gcc/clang warnings:
     # https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Warning-Options.html
     #
     # -Wall - turn on a lot of warnings
     # -Wchar-subscripts - catches array index using signed char
     # -Wcomment - catches nested comments
-    # -Wdeclaration-after-statement - MSVC doesn't like these
     # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
     # -Wendif-labels - catches `#else FOO` and `#endif FOO` not in comment
     # -Wenum-compare - catches comparison of different enum types
     # -Wignored-qualifiers - catches returns types with qualifiers like const
     # -Wint-to-pointer-cast - catches cast to pointer from integer of different size
     # -Wmultichar - catches multicharacter integer constants like 'THIS'
     # -Wnon-literal-null-conversion - catches expressions used as a null pointer constant
     # -Wnonnull - catches NULL used with functions arguments marked as non-null
@@ -1498,17 +1497,16 @@ if test "$GNU_CC"; then
     # -Wreturn-type - catches missing returns, zero false positives
     # -Wsequence-point - catches undefined order behavior like `a = a++`
     # -Wsign-compare - catches comparison of signed and unsigned types
     # -Wtrigraphs - catches unlikely use of trigraphs
     # -Wtype-limits - catches overflow bugs, few false positives
     # -Wunknown-pragmas - catches unexpected #pragma directives
     #
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall"
-    _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wdeclaration-after-statement"
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wempty-body"
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wpointer-to-int-cast"
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wsign-compare"
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wtype-limits"
 
     # Treat some warnings as errors if --enable-warnings-as-errors:
     if test "$MOZ_ENABLE_WARNINGS_AS_ERRORS"; then
         _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=char-subscripts"
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -1183,17 +1183,16 @@ if test "$GNU_CC"; then
 
     # Turn on gcc/clang warnings:
     # https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Warning-Options.html
     #
     # -Wall - turn on a lot of warnings
     # -Waddress - catches suspicious uses of memory addresses
     # -Wchar-subscripts - catches array index using signed char
     # -Wcomment - catches nested comments
-    # -Wdeclaration-after-statement - MSVC doesn't like these
     # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
     # -Wendif-labels - catches `#else FOO` and `#endif FOO` not in comment
     # -Wenum-compare - catches comparison of different enum types
     # -Wignored-qualifiers - catches returns types with qualifiers like const
     # -Wimplicit-function-declaration - catches missing C function prototypes
     # -Wint-to-pointer-cast - catches cast to pointer from integer of different size
     # -Wmissing-braces - catches aggregate initializers missing nested braces
     # -Wmultichar - catches multicharacter integer constants like 'THIS'
@@ -1208,17 +1207,16 @@ if test "$GNU_CC"; then
     # -Wsign-compare - catches comparison of signed and unsigned types
     # -Wswitch - catches switches without all enum cases or default case
     # -Wtrigraphs - catches unlikely use of trigraphs
     # -Wtype-limits - catches overflow bugs, few false positives
     # -Wunknown-pragmas - catches unexpected #pragma directives
     # -Wwrite-strings - catches non-const char* pointers to string literals
     #
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall"
-    _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wdeclaration-after-statement"
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wsign-compare"
     _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wtype-limits"
 
     # Treat some warnings as errors if --enable-warnings-as-errors:
     if test "$MOZ_ENABLE_WARNINGS_AS_ERRORS"; then
         _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=address"
         _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=char-subscripts"
         _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=comment"
--- a/media/libcubeb/src/moz.build
+++ b/media/libcubeb/src/moz.build
@@ -48,17 +48,16 @@ if CONFIG['OS_TARGET'] == 'WINNT':
         'cubeb_winmm.c',
     ]
     DEFINES['USE_WINMM'] = True
     DEFINES['USE_WASAPI'] = True
 
 if CONFIG['OS_TARGET'] == 'Android':
     SOURCES += ['cubeb_opensl.c']
     SOURCES += ['cubeb_resampler.cpp']
-    SOURCES['cubeb_opensl.c'].flags += ['-Wno-declaration-after-statement']
     DEFINES['USE_OPENSL'] = True
     if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
         SOURCES += [
             'cubeb_audiotrack.c',
         ]
         DEFINES['USE_AUDIOTRACK'] = True
 
 if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
--- a/media/libopus/moz.build
+++ b/media/libopus/moz.build
@@ -106,11 +106,10 @@ if CONFIG['CPU_ARCH'] == 'arm' and CONFI
     # opcodes; actual arch detection is done at runtime.
     ASFLAGS += [
         '-march=armv7-a',
         '-mfpu=neon',
     ]
 
 # Suppress warnings in third-party code.
 if CONFIG['GNU_CC']:
-    CFLAGS += ['-Wno-declaration-after-statement']
     if CONFIG['CLANG_CXX']:
         CFLAGS += ['-Wno-\#pragma-messages']
--- a/media/libstagefright/moz.build
+++ b/media/libstagefright/moz.build
@@ -147,17 +147,16 @@ if CONFIG['_MSC_VER']:
         '-wd4309', # '=' : truncation of constant value
         '-wd4355', # 'this' : used in base member initializer list
         '-wd4804', # '>' : unsafe use of type 'bool' in operation
         '-wd4099', # mismatched class/struct tags
     ]
 elif CONFIG['GNU_CXX']:
     CFLAGS += [
         '-Wno-comment',
-        '-Wno-declaration-after-statement',
         '-Wno-sign-compare'
     ]
     CXXFLAGS += [
         '-Wno-format',
         '-Wno-multichar',
         '-Wno-sign-compare',
         '-Wno-unused',
     ]
--- a/media/pocketsphinx/moz.build
+++ b/media/pocketsphinx/moz.build
@@ -45,17 +45,16 @@ SOURCES += [
     'src/ngram_search.c',
     'src/s2_semi_mgau.c',
     'src/state_align_search.c',
 ]
 
 # Suppress warnings in third-party code.
 if CONFIG['GNU_CC']:
     CFLAGS += [
-        '-Wno-declaration-after-statement',
         '-Wno-sign-compare',
     ]
     if CONFIG['CLANG_CXX']:
         CFLAGS += ['-Wno-incompatible-pointer-types-discards-qualifiers']
 
 if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
     NO_VISIBILITY_FLAGS = True,