New issue
Advanced search Search tips

Issue 766484 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: iOS , Mac
Pri: 3
Type: Bug



Sign in to add a comment

Compilation of .c and .m files use c99 instead of c11 on iOS and macOS

Project Member Reported by sdefresne@chromium.org, Sep 19 2017

Issue description

When targeting iOS or macOS, pure C or Objective-C file have both -std=c11 and -std=c99 on the command-line in that order. This means that pure C or Objective-C files are built using c99 instead of c11:

$ clang -dM -E -x c -std=c11 /dev/null | grep __STDC_VERSION__
#define __STDC_VERSION__ 201112L
$ clang -dM -E -x c -std=c11 -std=c99 /dev/null | grep __STDC_VERSION__
#define __STDC_VERSION__ 199901L
$ ninja -C out/Debug-iphonesimulator -v obj/ios/web_view/shell/shell/shell_app_delegate.o
[1/1] /Users/sdefresne/Tools/goma/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF obj/ios/web_view/shell/shell/shell_app_delegate.o.d -DV8_DEPRECATION_WARNINGS -DNO_TCMALLOC -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=\"313222-1\" -DCR_XCODE_VERSION=0900 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -I../.. -Igen -I../../third_party/libwebp/src -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -fcolor-diagnostics -arch x86_64 -Wall -Werror -Wextra -Wundeclared-selector -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -Wno-enum-compare-switch -Wno-tautological-unsigned-zero-compare -O0 -fno-omit-frame-pointer -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk -stdlib=libc++ -mios-simulator-version-min=9.0 -fvisibility=hidden -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-auto-raw-pointer -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -F . -std=c11 -std=c99 -Wobjc-missing-property-synthesis -fobjc-arc -c ../../ios/web_view/shell/shell_app_delegate.m -o obj/ios/web_view/shell/shell/shell_app_delegate.o


 
Project Member

Comment 1 by bugdroid1@chromium.org, Sep 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7b0bfa078e3aff89974e6772cf2fa4e670e4f136

commit 7b0bfa078e3aff89974e6772cf2fa4e670e4f136
Author: Sylvain Defresne <sdefresne@chromium.org>
Date: Tue Sep 19 12:44:41 2017

Remove override of C standard on iOS/macOS.

The CL https://chromium-review.googlesource.com/578630 configured
all platform to use C11 but did not remove the code enabling C99
on iOS/macOS. This caused iOS/macOS to use an older standard.

Bug:  766484 
Change-Id: I31090257abe4feb770a0b088cfa657e2b42ca624
Reviewed-on: https://chromium-review.googlesource.com/671349
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502832}
[modify] https://crrev.com/7b0bfa078e3aff89974e6772cf2fa4e670e4f136/build/config/ios/BUILD.gn
[modify] https://crrev.com/7b0bfa078e3aff89974e6772cf2fa4e670e4f136/build/config/mac/BUILD.gn

Status: Fixed (was: Started)
Cc: olivierrobin@chromium.org

Sign in to add a comment