Commit e868c489 authored by Wang Qing's avatar Wang Qing Committed by Commit Bot

Fix "for" loop initial declarations are only allowed in C99 or C11 mode.

Compiled chromium on loongson3a platform(mips64el architecture) with gcc-4.9.3, occurs errors
about that ‘for’ loop initial declarations are only allowed in C99 or C11 mode.

Bug: 746767

R= dpranke@chromium.org, scottmg@chromium.org

Change-Id: I8809ca16d3e647c967fb7117437a635d8ed05bef
Reviewed-on: https://chromium-review.googlesource.com/578630Reviewed-by: default avatarBrett Wilson <brettw@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488644}
parent 83622231
......@@ -451,19 +451,21 @@ config("compiler") {
cflags += [ "-fdebug-prefix-map=$absolute_path=." ]
}
# C++11 compiler flags setup.
# C11/C++11 compiler flags setup.
# ---------------------------
if (is_linux || is_android || (is_nacl && is_clang) || current_os == "aix") {
# gnu++11 instead of c++11 is needed because some code uses typeof() (a
# GNU extension).
# gnu11/gnu++11 instead of c11/c++11 is needed because some code uses typeof()
# (a GNU extension).
# TODO(thakis): Eventually switch this to c++11 instead,
# http://crbug.com/427584
cflags_c += [ "-std=gnu11" ]
cflags_cc += [ "-std=gnu++11" ]
} else if (!is_win && !is_nacl) {
# TODO(mcgrathr) - the NaCl GCC toolchain doesn't support either gnu++11
# or c++11; we technically don't need this toolchain any more, but there
# TODO(mcgrathr) - the NaCl GCC toolchain doesn't support either gnu11/gnu++11
# or c11/c++11; we technically don't need this toolchain any more, but there
# are still a few buildbots using it, so until those are turned off
# we need the !is_nacl clause and the (is_nacl && is_clang) clause, above.
cflags_c += [ "-std=c11" ]
cflags_cc += [ "-std=c++11" ]
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment