Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-12-11 01:35:14 +0300
committerJunio C Hamano <gitster@pobox.com>2021-12-11 01:35:14 +0300
commitd67fc4bf0ba89835c61efd1279c732fc640b3b2d (patch)
treeeb26076973292289415d3311e4e3db6f9135c06e
parentb8148376a2dbb02ade419c2e3fdc478c1f0981dd (diff)
parent7bc341e21b566c6685b7d993ca80459f9994be38 (diff)
Merge branch 'bc/require-c99'
Weather balloon to break people with compilers that do not support C99. * bc/require-c99: git-compat-util: add a test balloon for C99 support
-rw-r--r--Makefile2
-rw-r--r--contrib/buildsystems/CMakeLists.txt2
-rw-r--r--git-compat-util.h13
3 files changed, 15 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d56c0e4aad..ed75ed422b 100644
--- a/Makefile
+++ b/Makefile
@@ -1212,7 +1212,7 @@ ARFLAGS = rcs
PTHREAD_CFLAGS =
# For the 'sparse' target
-SPARSE_FLAGS ?=
+SPARSE_FLAGS ?= -std=gnu99
SP_EXTRA_FLAGS = -Wno-universal-initializer
# For informing GIT-BUILD-OPTIONS of the SANITIZE=leak target
diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index 86b4611446..be67b4dab0 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -208,7 +208,7 @@ endif()
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
- add_compile_options(/MP)
+ add_compile_options(/MP /std:c11)
endif()
#default behaviour
diff --git a/git-compat-util.h b/git-compat-util.h
index c6bd2a84e5..98c4f2c81e 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -1,6 +1,19 @@
#ifndef GIT_COMPAT_UTIL_H
#define GIT_COMPAT_UTIL_H
+#if __STDC_VERSION__ - 0 < 199901L
+/*
+ * Git is in a testing period for mandatory C99 support in the compiler. If
+ * your compiler is reasonably recent, you can try to enable C99 support (or,
+ * for MSVC, C11 support). If you encounter a problem and can't enable C99
+ * support with your compiler (such as with "-std=gnu99") and don't have access
+ * to one with this support, such as GCC or Clang, you can remove this #if
+ * directive, but please report the details of your system to
+ * git@vger.kernel.org.
+ */
+#error "Required C99 support is in a test phase. Please see git-compat-util.h for more details."
+#endif
+
#ifdef USE_MSVC_CRTDBG
/*
* For these to work they must appear very early in each