{"thread":{"id":"37869","subject":"[PATCH 0/2] add some new autoconf macros for searching the possible warning flags allowed by the current version of the gcc compiler","startedAt":"2014-11-03T14:57:19Z","lastAt":"2014-11-03T19:49:31Z","messageCount":5,"participants":["Elia Pinto","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"251300","messageId":"1415026641-24767-1-git-send-email-gitter.spiros@gmail.com","threadId":"37869","inReplyTo":null,"subject":"[PATCH 0/2] add some new autoconf macros for searching the possible warning flags allowed by the current version of the gcc compiler","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-11-03T14:57:19Z","receivedAt":"2014-11-03T14:57:19Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"This patch series introduces some new autoconf macros for searching the possible warning flags allowed by the current version of the gcc compiler. \nUsing these macros it adds a new option --enable-gcc-warnings (default off). There are several possible gcc warnings flags, \ni have included some of the most useful in my opinion but certainly there are several other perhaps more useful for git, so comments are welcome. \nNaturally the new macro are not limited only to the portable search of the gcc warning flags or to gcc in first place in any way\n\nElia Pinto (2):\n  configure.ac: add new autoconf macro for checking valid compiler\n    flags\n  configure.ac: use GIT_CC_CHECK_FLAG_APPEND for adding\n    --with-gcc-warnings configure option\n\n Makefile     |   12 ++++-\n configure.ac |  141 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-\n 2 files changed, 149 insertions(+), 4 deletions(-)\n\n-- \n1.7.10.4\n"},{"id":"251302","messageId":"1415026641-24767-2-git-send-email-gitter.spiros@gmail.com","threadId":"37869","inReplyTo":"1415026641-24767-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 1/2] configure.ac: add new autoconf macro for checking valid compiler flags","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-11-03T14:57:20Z","receivedAt":"2014-11-03T14:57:20Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Add GIT_CC_CHECK_FLAG_APPEND, GIT_CC_CHECK_FLAGS_APPEND\nand GIT_CC_CHECK_LDFLAGS autoconf macro.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n Makefile     |    6 ++++--\n configure.ac |   45 +++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 49 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 827006b..23485f1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -344,10 +344,12 @@ GIT-VERSION-FILE: FORCE\n \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n -include GIT-VERSION-FILE\n \n+GIT_CFLAGS  =\n+GIT_LDFLAGS =\n # CFLAGS and LDFLAGS are for the users to override from the command line.\n \n-CFLAGS = -g -O2 -Wall\n-LDFLAGS =\n+CFLAGS = -g -O2 -Wall $(GIT_CFLAGS)\n+LDFLAGS = $(GIT_LDFLAGS)\n ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)\n ALL_LDFLAGS = $(LDFLAGS)\n STRIP ?= strip\ndiff --git a/configure.ac b/configure.ac\nindex 6af9647..c67ca60 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -139,6 +139,51 @@ if test -n \"$1\"; then\n fi\n ])\n \n+\n+dnl Check if FLAG in ENV-VAR is supported by compiler and append it\n+dnl to WHERE-TO-APPEND variable\n+dnl GIT_CC_CHECK_FLAG_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG])\n+\n+AC_DEFUN([GIT_CC_CHECK_FLAG_APPEND], [\n+  AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2],\n+                 AS_TR_SH([cc_cv_$2_$3]),\n+          [eval \"AS_TR_SH([cc_save_$2])='${$2}'\"\n+           eval \"AS_TR_SH([$2])='-Werror $3'\"\n+           AC_LINK_IFELSE([AC_LANG_SOURCE([int a = 0; int main(void) { return a; } ])],\n+                          [eval \"AS_TR_SH([cc_cv_$2_$3])='yes'\"],\n+                          [eval \"AS_TR_SH([cc_cv_$2_$3])='no'\"])\n+           eval \"AS_TR_SH([$2])='$cc_save_$2'\"])\n+\n+  AS_IF([eval test x$]AS_TR_SH([cc_cv_$2_$3])[ = xyes],\n+        [eval \"$1='${$1} $3'\"])\n+])\n+\n+dnl GIT_CC_CHECK_FLAGS_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG1 FLAG2])\n+AC_DEFUN([GIT_CC_CHECK_FLAGS_APPEND], [\n+  for flag in $3; do\n+    GIT_CC_CHECK_FLAG_APPEND($1, $2, $flag)\n+  done\n+])\n+\n+dnl Check if the flag is supported by linker (cacheable)\n+dnl GIT_CC_CHECK_LDFLAGS([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])\n+\n+AC_DEFUN([GIT_CC_CHECK_LDFLAGS], [\n+  AC_CACHE_CHECK([if $CC supports $1 flag],\n+    AS_TR_SH([cc_cv_ldflags_$1]),\n+    [ac_save_LDFLAGS=\"$LDFLAGS\"\n+     LDFLAGS=\"$LDFLAGS $1\"\n+     AC_LINK_IFELSE([int main() { return 1; }],\n+       [eval \"AS_TR_SH([cc_cv_ldflags_$1])='yes'\"],\n+       [eval \"AS_TR_SH([cc_cv_ldflags_$1])=\"])\n+     LDFLAGS=\"$ac_save_LDFLAGS\"\n+    ])\n+\n+  AS_IF([eval test x$]AS_TR_SH([cc_cv_ldflags_$1])[ = xyes],\n+    [$2], [$3])\n+])\n+\n+\n ## Configure body starts here.\n \n AC_PREREQ(2.59)\n-- \n1.7.10.4\n"},{"id":"251301","messageId":"1415026641-24767-3-git-send-email-gitter.spiros@gmail.com","threadId":"37869","inReplyTo":"1415026641-24767-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 2/2] configure.ac: use GIT_CC_CHECK_FLAG_APPEND for adding --with-gcc-warnings configure option","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-11-03T14:57:21Z","receivedAt":"2014-11-03T14:57:21Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Use the GIT_CC_CHECK_FLAGS_APPEND autoconf macro\nfor add in a portable way the new configure option\n--enable-gcc-warnings (default off).\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n Makefile     |   12 ++++++--\n configure.ac |   96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--\n 2 files changed, 103 insertions(+), 5 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 23485f1..9db34e2 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -344,11 +344,9 @@ GIT-VERSION-FILE: FORCE\n \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n -include GIT-VERSION-FILE\n \n-GIT_CFLAGS  =\n-GIT_LDFLAGS =\n # CFLAGS and LDFLAGS are for the users to override from the command line.\n \n-CFLAGS = -g -O2 -Wall $(GIT_CFLAGS)\n+CFLAGS = -g -O2 -Wall \n LDFLAGS = $(GIT_LDFLAGS)\n ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)\n ALL_LDFLAGS = $(LDFLAGS)\n@@ -1517,6 +1515,14 @@ ifdef DEFAULT_HELP_FORMAT\n BASIC_CFLAGS += -DDEFAULT_HELP_FORMAT='\"$(DEFAULT_HELP_FORMAT)\"'\n endif\n \n+ifdef GIT_CFLAGS\n+BASIC_CFLAGS += $(GIT_CFLAGS)\n+endif\n+\n+ifdef GIT_LDFLAGS\n+BASIC_LDFLAGS += $(GIT_LDFLAGS)\n+endif\n+\n ALL_CFLAGS += $(BASIC_CFLAGS)\n ALL_LDFLAGS += $(BASIC_LDFLAGS)\n \ndiff --git a/configure.ac b/configure.ac\nindex c67ca60..95d5d10 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -1,4 +1,4 @@\n-#                                               -*- Autoconf -*-\n+#                                               -*- Autoconf -*- \\\n # Process this file with autoconf to produce a configure script.\n \n ## Definitions of private macros.\n@@ -433,7 +433,99 @@ AS_HELP_STRING([],[ARG is the full path to the Tcl/Tk interpreter.])\n AS_HELP_STRING([],[Bare --with-tcltk will make the GUI part only if])\n AS_HELP_STRING([],[Tcl/Tk interpreter will be found in a system.]),\n GIT_PARSE_WITH(tcltk))\n-#\n+\n+\n+# Turn gcc warning\n+\n+AC_ARG_ENABLE([gcc-warnings],\n+  [AS_HELP_STRING([--enable-gcc-warnings],\n+                  [turn on GCC warnings (for developers)@<:@default=no@:>@])],\n+  [case $enableval in\n+     yes|no) ;;\n+     *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;\n+   esac\n+   git_gcc_warnings=$enableval],\n+  [git_gcc_warnings=no]\n+)\n+\n+AS_IF([test \"x$git_gcc_warnings\" = xyes ],[ \n+# Add/Delete as needed\n+GIT_CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\\\n+  -Wall  \\\n+  -Wextra  \\\n+  -Wformat-y2k  \\\n+  -fdiagnostics-show-option \\\n+  -funit-at-a-time \\\n+  -fstrict-aliasing \\\n+  -Wstrict-overflow \\\n+  -fstrict-overflow \\\n+  -Wpointer-arith \\\n+  -Wundef \\\n+  -Wformat-security \\\n+  -Winit-self \\\n+  -Wmissing-include-dirs \\\n+  -Wunused \\\n+  -Wunknown-pragmas \\\n+  -Wstrict-aliasing \\\n+  -Wshadow \\\n+  -Wbad-function-cast \\\n+  -Wcast-align \\\n+  -Wwrite-strings \\\n+  -Wlogical-op \\\n+  -Waggregate-return \\\n+  -Wstrict-prototypes \\\n+  -Wold-style-definition \\\n+  -Wmissing-prototypes \\\n+  -Wmissing-declarations \\\n+  -Wmissing-noreturn \\\n+  -Wmissing-format-attribute \\\n+  -Wredundant-decls \\\n+  -Wnested-externs \\\n+  -Winline \\\n+  -Winvalid-pch \\\n+  -Wvolatile-register-var \\\n+  -Wdisabled-optimization \\\n+  -Wbuiltin-macro-redefined \\\n+  -Wmudflap \\\n+  -Wpacked-bitfield-compat \\\n+  -Wsync-nand \\\n+  -Wattributes \\\n+  -Wcoverage-mismatch \\\n+  -Wmultichar \\\n+  -Wcpp \\\n+  -Wdeprecated-declarations \\\n+  -Wdiv-by-zero \\\n+  -Wdouble-promotion \\\n+  -Wendif-labels \\\n+  -Wformat-contains-nul \\\n+  -Wformat-extra-args \\\n+  -Wformat-zero-length \\\n+  -Wformat=2 \\\n+  -Wmultichar \\\n+  -Wnormalized=nfc \\\n+  -Woverflow \\\n+  -Wpointer-to-int-cast \\\n+  -Wpragmas \\\n+  -Wsuggest-attribute=const \\\n+  -Wsuggest-attribute=noreturn \\\n+  -Wsuggest-attribute=pure \\\n+  -Wtrampolines \\\n+  -Wno-missing-field-initializers \\\n+  -Wno-sign-compare \\\n+  -Wjump-misses-init \\\n+  -Wno-format-nonliteral \\\n+  -fstack-protector-all \\\n+  -fasynchronous-unwind-tables \\\n+  -fdiagnostics-show-option \\\n+  -funit-at-a-time \\\n+  -fipa-pure-const \\\n+  -Wno-aggregate-return \\\n+  -Wno-redundant-decls \\\n+  -Wdeclaration-after-statement ])\n+\n+GIT_CONF_SUBST([GIT_CFLAGS],[$with_cflags])\n+])\n+\n \n \n ## Checks for programs.\n-- \n1.7.10.4\n"},{"id":"251351","messageId":"xmqq61ewrs3j.fsf@gitster.dls.corp.google.com","threadId":"37869","inReplyTo":"1415026641-24767-2-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 1/2] configure.ac: add new autoconf macro for checking valid compiler flags","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-03T19:39:44Z","receivedAt":"2014-11-03T19:39:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Elia Pinto <gitter.spiros@gmail.com> writes:\n\n> Add GIT_CC_CHECK_FLAG_APPEND, GIT_CC_CHECK_FLAGS_APPEND\n> and GIT_CC_CHECK_LDFLAGS autoconf macro.\n\n... which does what and for what purpose?\n\nDon't explain it to me in your response, or tell me to read the\npatch text.  I am speaking for those who have to read \"git log\"\noutput down the line and need to get the big picture.\n\nIn the bigger picture, what is important is \"why\" than \"how\".\n\nYou add a handy way to give list of possible compilation flags and\nadd as many of them as we can without triggering errors to CFLAGS\nand LDFLAGS.  Why is that a good thing to do?  What kind of\ncompilation flags you are planning to throw at these macros?  I\nthink a mere mention of the latter will be sufficient to remind the\nreader why this change would be a good idea.\n\n>\n> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>\n> ---\n>  Makefile     |    6 ++++--\n>  configure.ac |   45 +++++++++++++++++++++++++++++++++++++++++++++\n>  2 files changed, 49 insertions(+), 2 deletions(-)\n>\n> diff --git a/Makefile b/Makefile\n> index 827006b..23485f1 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -344,10 +344,12 @@ GIT-VERSION-FILE: FORCE\n>  \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n>  -include GIT-VERSION-FILE\n>  \n> +GIT_CFLAGS  =\n> +GIT_LDFLAGS =\n>  # CFLAGS and LDFLAGS are for the users to override from the command line.\n>  \n> -CFLAGS = -g -O2 -Wall\n> -LDFLAGS =\n> +CFLAGS = -g -O2 -Wall $(GIT_CFLAGS)\n> +LDFLAGS = $(GIT_LDFLAGS)\n>  ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)\n>  ALL_LDFLAGS = $(LDFLAGS)\n>  STRIP ?= strip\n> diff --git a/configure.ac b/configure.ac\n> index 6af9647..c67ca60 100644\n> --- a/configure.ac\n> +++ b/configure.ac\n> @@ -139,6 +139,51 @@ if test -n \"$1\"; then\n>  fi\n>  ])\n>  \n> +\n> +dnl Check if FLAG in ENV-VAR is supported by compiler and append it\n> +dnl to WHERE-TO-APPEND variable\n> +dnl GIT_CC_CHECK_FLAG_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG])\n> +\n> +AC_DEFUN([GIT_CC_CHECK_FLAG_APPEND], [\n> +  AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2],\n> +                 AS_TR_SH([cc_cv_$2_$3]),\n> +          [eval \"AS_TR_SH([cc_save_$2])='${$2}'\"\n> +           eval \"AS_TR_SH([$2])='-Werror $3'\"\n> +           AC_LINK_IFELSE([AC_LANG_SOURCE([int a = 0; int main(void) { return a; } ])],\n> +                          [eval \"AS_TR_SH([cc_cv_$2_$3])='yes'\"],\n> +                          [eval \"AS_TR_SH([cc_cv_$2_$3])='no'\"])\n> +           eval \"AS_TR_SH([$2])='$cc_save_$2'\"])\n> +\n> +  AS_IF([eval test x$]AS_TR_SH([cc_cv_$2_$3])[ = xyes],\n> +        [eval \"$1='${$1} $3'\"])\n> +])\n> +\n> +dnl GIT_CC_CHECK_FLAGS_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG1 FLAG2])\n> +AC_DEFUN([GIT_CC_CHECK_FLAGS_APPEND], [\n> +  for flag in $3; do\n> +    GIT_CC_CHECK_FLAG_APPEND($1, $2, $flag)\n> +  done\n> +])\n> +\n> +dnl Check if the flag is supported by linker (cacheable)\n> +dnl GIT_CC_CHECK_LDFLAGS([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])\n\nMissing SP after comma?  I do not particularly mind commas without\nleading SP in m4 source, but please be consistent unless there is a\ncompelling reason not to (and I do not think there is in this case).\n\n> +\n> +AC_DEFUN([GIT_CC_CHECK_LDFLAGS], [\n> +  AC_CACHE_CHECK([if $CC supports $1 flag],\n> +    AS_TR_SH([cc_cv_ldflags_$1]),\n> +    [ac_save_LDFLAGS=\"$LDFLAGS\"\n> +     LDFLAGS=\"$LDFLAGS $1\"\n> +     AC_LINK_IFELSE([int main() { return 1; }],\n> +       [eval \"AS_TR_SH([cc_cv_ldflags_$1])='yes'\"],\n> +       [eval \"AS_TR_SH([cc_cv_ldflags_$1])=\"])\n> +     LDFLAGS=\"$ac_save_LDFLAGS\"\n> +    ])\n> +\n> +  AS_IF([eval test x$]AS_TR_SH([cc_cv_ldflags_$1])[ = xyes],\n> +    [$2], [$3])\n> +])\n> +\n> +\n>  ## Configure body starts here.\n>  \n>  AC_PREREQ(2.59)\n"},{"id":"251353","messageId":"xmqq1tpkrrn8.fsf@gitster.dls.corp.google.com","threadId":"37869","inReplyTo":"1415026641-24767-3-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 2/2] configure.ac: use GIT_CC_CHECK_FLAG_APPEND for adding --with-gcc-warnings configure option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-03T19:49:31Z","receivedAt":"2014-11-03T19:49:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Elia Pinto <gitter.spiros@gmail.com> writes:\n\n> Use the GIT_CC_CHECK_FLAGS_APPEND autoconf macro\n> for add in a portable way the new configure option\n> --enable-gcc-warnings (default off).\n>\n> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>\n> ---\n>  Makefile     |   12 ++++++--\n>  configure.ac |   96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--\n>  2 files changed, 103 insertions(+), 5 deletions(-)\n>\n> diff --git a/Makefile b/Makefile\n> index 23485f1..9db34e2 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -344,11 +344,9 @@ GIT-VERSION-FILE: FORCE\n>  \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n>  -include GIT-VERSION-FILE\n>  \n> -GIT_CFLAGS  =\n> -GIT_LDFLAGS =\n>  # CFLAGS and LDFLAGS are for the users to override from the command line.\n>  \n> -CFLAGS = -g -O2 -Wall $(GIT_CFLAGS)\n> +CFLAGS = -g -O2 -Wall \n>  LDFLAGS = $(GIT_LDFLAGS)\n>  ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)\n>  ALL_LDFLAGS = $(LDFLAGS)\n\nReverting what you did just a minute ago?\n\nI am debating myself if I should say that the new placement may make\nmore sense.  On the one hand, -Wanything is more or less developer's\npersonal taste and should be easily overridable via CFLAGS for each\ninvocation of \"make\", just like -g and -O2.  On the other hand, some\nclass of error checking is so useful and bulletproof not to give us\nfalse positives that we may want to encourage people to always use\nthem when available.  The placement in 1/2 was in line with the\nformer, but the updated placement makes it very hard to selectively\ndisable GCC crud that barfs unnecessarily without disabling\neverything by GIT_CFLAGS=\"\", I am afraid.\n\nLooking at the way the patch to configure.ac tries to add many\nthings, I am not sure if these two patches are good idea (note: I\ndidn't say \"I am sure this is going in a wrong direction\").  Is it\nadding everything under the sun, or after careful consideration on\neach and every ones to see how false-positive-prone it is?\n\n> @@ -1517,6 +1515,14 @@ ifdef DEFAULT_HELP_FORMAT\n>  BASIC_CFLAGS += -DDEFAULT_HELP_FORMAT='\"$(DEFAULT_HELP_FORMAT)\"'\n>  endif\n>  \n> +ifdef GIT_CFLAGS\n> +BASIC_CFLAGS += $(GIT_CFLAGS)\n> +endif\n> +\n> +ifdef GIT_LDFLAGS\n> +BASIC_LDFLAGS += $(GIT_LDFLAGS)\n> +endif\n> +\n>  ALL_CFLAGS += $(BASIC_CFLAGS)\n>  ALL_LDFLAGS += $(BASIC_LDFLAGS)\n>  \n> diff --git a/configure.ac b/configure.ac\n> index c67ca60..95d5d10 100644\n> --- a/configure.ac\n> +++ b/configure.ac\n> @@ -1,4 +1,4 @@\n> -#                                               -*- Autoconf -*-\n> +#                                               -*- Autoconf -*- \\\n>  # Process this file with autoconf to produce a configure script.\n>  \n>  ## Definitions of private macros.\n> @@ -433,7 +433,99 @@ AS_HELP_STRING([],[ARG is the full path to the Tcl/Tk interpreter.])\n>  AS_HELP_STRING([],[Bare --with-tcltk will make the GUI part only if])\n>  AS_HELP_STRING([],[Tcl/Tk interpreter will be found in a system.]),\n>  GIT_PARSE_WITH(tcltk))\n> -#\n> +\n> +\n> +# Turn gcc warning\n> +\n> +AC_ARG_ENABLE([gcc-warnings],\n> +  [AS_HELP_STRING([--enable-gcc-warnings],\n> +                  [turn on GCC warnings (for developers)@<:@default=no@:>@])],\n> +  [case $enableval in\n> +     yes|no) ;;\n> +     *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;\n> +   esac\n> +   git_gcc_warnings=$enableval],\n> +  [git_gcc_warnings=no]\n> +)\n> +\n> +AS_IF([test \"x$git_gcc_warnings\" = xyes ],[ \n> +# Add/Delete as needed\n> +GIT_CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\\\n> +  -Wall  \\\n> +  -Wextra  \\\n> +  -Wformat-y2k  \\\n> +  -fdiagnostics-show-option \\\n> +  -funit-at-a-time \\\n> +  -fstrict-aliasing \\\n> +  -Wstrict-overflow \\\n> +  -fstrict-overflow \\\n> +  -Wpointer-arith \\\n> +  -Wundef \\\n> +  -Wformat-security \\\n> +  -Winit-self \\\n> +  -Wmissing-include-dirs \\\n> +  -Wunused \\\n> +  -Wunknown-pragmas \\\n> +  -Wstrict-aliasing \\\n> +  -Wshadow \\\n> +  -Wbad-function-cast \\\n> +  -Wcast-align \\\n> +  -Wwrite-strings \\\n> +  -Wlogical-op \\\n> +  -Waggregate-return \\\n> +  -Wstrict-prototypes \\\n> +  -Wold-style-definition \\\n> +  -Wmissing-prototypes \\\n> +  -Wmissing-declarations \\\n> +  -Wmissing-noreturn \\\n> +  -Wmissing-format-attribute \\\n> +  -Wredundant-decls \\\n> +  -Wnested-externs \\\n> +  -Winline \\\n> +  -Winvalid-pch \\\n> +  -Wvolatile-register-var \\\n> +  -Wdisabled-optimization \\\n> +  -Wbuiltin-macro-redefined \\\n> +  -Wmudflap \\\n> +  -Wpacked-bitfield-compat \\\n> +  -Wsync-nand \\\n> +  -Wattributes \\\n> +  -Wcoverage-mismatch \\\n> +  -Wmultichar \\\n> +  -Wcpp \\\n> +  -Wdeprecated-declarations \\\n> +  -Wdiv-by-zero \\\n> +  -Wdouble-promotion \\\n> +  -Wendif-labels \\\n> +  -Wformat-contains-nul \\\n> +  -Wformat-extra-args \\\n> +  -Wformat-zero-length \\\n> +  -Wformat=2 \\\n> +  -Wmultichar \\\n> +  -Wnormalized=nfc \\\n> +  -Woverflow \\\n> +  -Wpointer-to-int-cast \\\n> +  -Wpragmas \\\n> +  -Wsuggest-attribute=const \\\n> +  -Wsuggest-attribute=noreturn \\\n> +  -Wsuggest-attribute=pure \\\n> +  -Wtrampolines \\\n> +  -Wno-missing-field-initializers \\\n> +  -Wno-sign-compare \\\n> +  -Wjump-misses-init \\\n> +  -Wno-format-nonliteral \\\n> +  -fstack-protector-all \\\n> +  -fasynchronous-unwind-tables \\\n> +  -fdiagnostics-show-option \\\n> +  -funit-at-a-time \\\n> +  -fipa-pure-const \\\n> +  -Wno-aggregate-return \\\n> +  -Wno-redundant-decls \\\n> +  -Wdeclaration-after-statement ])\n> +\n> +GIT_CONF_SUBST([GIT_CFLAGS],[$with_cflags])\n> +])\n> +\n>  \n>  \n>  ## Checks for programs.\n"}]}