Changed C99 to C11 (#29687)

* Changed C99 to C11

* Remove gnu99 option

* Switch to gnu11 for xcode
pull/29741/merge
Esun Kim 3 years ago committed by GitHub
parent 4a855552a9
commit ec58a346f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      CMakeLists.txt
  2. 2
      Makefile
  3. 6
      bazel/grpc_build_system.bzl
  4. 4
      examples/objective-c/auth_sample/AuthSample.xcodeproj/project.pbxproj
  5. 4
      examples/objective-c/helloworld/HelloWorld.xcodeproj/project.pbxproj
  6. 4
      examples/objective-c/route_guide/RouteGuideClient.xcodeproj/project.pbxproj
  7. 2
      grpc.gyp
  8. 2
      setup.py
  9. 4
      src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj
  10. 4
      src/objective-c/examples/SwiftSample/SwiftSample.xcodeproj/project.pbxproj
  11. 8
      src/objective-c/tests/Tests.xcodeproj/project.pbxproj
  12. 2
      src/ruby/ext/grpc/extconf.rb
  13. 4
      templates/CMakeLists.txt.template
  14. 2
      templates/Makefile.template
  15. 2
      templates/grpc.gyp.template
  16. 2
      templates/src/ruby/ext/grpc/extconf.rb.template
  17. 8
      test/cpp/ios/Tests.xcodeproj/project.pbxproj
  18. 2
      tools/run_tests/helper_scripts/build_python.sh

4
CMakeLists.txt generated

@ -220,9 +220,9 @@ if(WIN32)
set(_gRPC_PLATFORM_WINDOWS ON)
endif()
# Use C99 standard
# Use C11 standard
if (NOT DEFINED CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD 11)
endif()
# Add c++14 flags

2
Makefile generated

@ -356,7 +356,7 @@ HOST_CXX ?= $(CXX)
HOST_LD ?= $(LD)
HOST_LDXX ?= $(LDXX)
CFLAGS += -std=c99 $(W_EXTRA_SEMI)
CFLAGS += -std=c11 $(W_EXTRA_SEMI)
CXXFLAGS += -std=c++14
ifeq ($(SYSTEM),Darwin)
CXXFLAGS += -stdlib=libc++

@ -155,7 +155,7 @@ def grpc_cc_library(
visibility = _update_visibility(visibility)
copts = []
if language.upper() == "C":
copts = copts + if_not_windows(["-std=c99"])
copts = copts + if_not_windows(["-std=c11"])
linkopts = if_not_windows(["-pthread"]) + if_windows(["-defaultlib:ws2_32.lib"])
if select_deps:
for select_deps_entry in select_deps:
@ -360,7 +360,7 @@ def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data
EventEngine implementation differences
"""
if language.upper() == "C":
copts = copts + if_not_windows(["-std=c99"])
copts = copts + if_not_windows(["-std=c11"])
core_deps = deps + _get_external_deps(external_deps)
@ -429,7 +429,7 @@ def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], da
visibility = _update_visibility(visibility)
copts = []
if language.upper() == "C":
copts = ["-std=c99"]
copts = ["-std=c11"]
native.cc_binary(
name = name,
srcs = srcs,

@ -272,7 +272,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
@ -317,7 +317,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;

@ -260,7 +260,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
@ -303,7 +303,7 @@
COPY_PHASE_STRIP = NO;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;

@ -272,7 +272,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
@ -317,7 +317,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;

2
grpc.gyp generated

@ -67,7 +67,7 @@
],
'cflags_c': [
'-Werror',
'-std=c99',
'-std=c11',
],
'cflags_cc': [
'-Werror',

@ -252,7 +252,7 @@ if EXTRA_ENV_COMPILE_ARGS is None:
# available dynamically
EXTRA_ENV_COMPILE_ARGS += ' /MT'
elif "linux" in sys.platform:
EXTRA_ENV_COMPILE_ARGS += ' -std=gnu99 -fvisibility=hidden -fno-wrapv -fno-exceptions'
EXTRA_ENV_COMPILE_ARGS += ' -fvisibility=hidden -fno-wrapv -fno-exceptions'
elif "darwin" in sys.platform:
EXTRA_ENV_COMPILE_ARGS += ' -stdlib=libc++ -fvisibility=hidden -fno-wrapv -fno-exceptions -DHAVE_UNISTD_H'

@ -261,7 +261,7 @@
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
@ -304,7 +304,7 @@
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;

@ -273,7 +273,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
@ -320,7 +320,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;

@ -1270,7 +1270,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
@ -1609,7 +1609,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
@ -1656,7 +1656,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
@ -1699,7 +1699,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;

@ -102,7 +102,7 @@ $LDFLAGS << ' -Wl,-wrap,memcpy' if linux
$LDFLAGS << ' -static-libgcc -static-libstdc++' if linux
$LDFLAGS << ' -static' if windows
$CFLAGS << ' -std=c99 '
$CFLAGS << ' -std=c11 '
$CFLAGS << ' -Wall '
$CFLAGS << ' -Wextra '
$CFLAGS << ' -pedantic '

@ -263,9 +263,9 @@
set(_gRPC_PLATFORM_WINDOWS ON)
endif()
# Use C99 standard
# Use C11 standard
if (NOT DEFINED CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD 11)
endif()
# Add c++14 flags

@ -221,7 +221,7 @@
HOST_LD ?= $(LD)
HOST_LDXX ?= $(LDXX)
CFLAGS += -std=c99 ${' '.join(warning_var('$(W_%s)', warning) for warning in PREFERRED_WARNINGS)}
CFLAGS += -std=c11 ${' '.join(warning_var('$(W_%s)', warning) for warning in PREFERRED_WARNINGS)}
CXXFLAGS += -std=c++14
ifeq ($(SYSTEM),Darwin)
CXXFLAGS += -stdlib=libc++

@ -63,7 +63,7 @@
% endfor
'cflags_c': [
'-Werror',
'-std=c99',
'-std=c11',
],
'cflags_cc': [
'-Werror',

@ -104,7 +104,7 @@
$LDFLAGS << ' -static-libgcc -static-libstdc++' if linux
$LDFLAGS << ' -static' if windows
$CFLAGS << ' -std=c99 '
$CFLAGS << ' -std=c11 '
$CFLAGS << ' -Wall '
$CFLAGS << ' -Wextra '
$CFLAGS << ' -pedantic '

@ -259,7 +259,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
@ -457,7 +457,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
@ -501,7 +501,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
@ -544,7 +544,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;

@ -116,7 +116,7 @@ if [ "$(is_msys)" ]; then
fi
ROOT=$(pwd)
export CFLAGS="-I$ROOT/include -std=gnu99 -fno-wrapv $CFLAGS"
export CFLAGS="-I$ROOT/include -fno-wrapv $CFLAGS"
export GRPC_PYTHON_BUILD_WITH_CYTHON=1
export LANG=en_US.UTF-8

Loading…
Cancel
Save