summaryrefslogtreecommitdiff
path: root/m4/manywarnings.m4
Commit message (Collapse)AuthorAgeFilesLines
* manywarnings: use AS_IFPaul Eggert2023-04-231-6/+4
| | | | | | * m4/manywarnings.m4 (gl_MANYWARN_COMPLEMENT): Use AS_IF when the body contains Autoconf macros that could conceivably require something.
* manywarnings: update C warnings for GCC 13Paul Eggert2023-04-231-1/+2
| | | | | | | | | | Adjust for C programs compiled by GCC 13. (A C++ expert still needs to look at manywarnings-c++.m4.) * build-aux/gcc-warning.spec: Add warnings introduced in GCC 13. * doc/manywarnings.texi (manywarnings): Document flex arrays. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -fstrict-flex-arrays and -Wstrict-flex-arrays as these should be suitable for Gnulib-using code.
* manywarnings: omit -fno-common in GCC 10+Paul Eggert2023-04-231-3/+8
| | | | | | * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Omit -fno-common in GCC 10 and later, as it is the default there. Check exit status of ‘gcc --version’.
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* manywarnings: update C warnings for GCC 12Paul Eggert2022-05-121-0/+2
| | | | | | | | | Adjust for C programs compiled by GCC 12. (A C++ expert still needs to look at manywarnings-c++.m4.) * build-aux/gcc-warning.spec: Add warnings introduced in GCC 12. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wbidi-chars=any,ucn and -Wuse-after-free=3. Although not enabled by -Wall or -Wextra they seem suitable for Gnulib-using C code.
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* manywarnings: enable some malloc warningsPaul Eggert2021-08-021-9/+3
| | | | | | | | * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Stop adding -Wno-analyzer-double-free, -Wno-analyzer-null-dereference, and -Wno-analyzer-use-after-free, as these false alarms don’t seem to be as much of an issue now that we’ve pacified a couple of individual modules and GCC has some bug fixes.
* manywarnings: improve -fanalyzer malloc checkingPaul Eggert2021-08-011-2/+2
|
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* Assume autoconf >= 2.64.Bruno Haible2020-08-161-5/+3
| | | | | | | | | | | | | | | | | | | | * gnulib-tool (DEFAULT_AUTOCONF_MINVERSION): Set to 2.64. * DEPENDENCIES: Require Autoconf 2.64 or newer. * NEWS: Mention the changed requirement. * m4/00gnulib.m4 (_m4_divert_diversion, AC_DEFUN_ONCE): Remove macros. * m4/gnulib-common.m4 (AS_VAR_IF, AS_VAR_COPY): Remove macros. * m4/absolute-header.m4 (gl_ABSOLUTE_HEADER): Quote pushdef'ed variables. * m4/include_next.m4 (gl_NEXT_HEADERS_INTERNAL): Likewise. * m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Likewise. * m4/warnings.m4 (gl_COMPILER_OPTION_IF): Likewise. (gl_UNKNOWN_WARNINGS_ARE_ERRORS(C), gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++), gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)): Define through AC_DEFUN. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C), gl_MANYWARN_ALL_GCC(C++)): Likewise. * m4/iconv.m4 (AM_ICONV): Define through AC_DEFUN_ONCE directly. * m4/libunistring.m4 (gl_LIBUNISTRING): Likewise. * m4/configmake.m4: Update comment.
* manywarnings: improve port to GCC 10.1Paul Eggert2020-07-011-175/+31
| | | | | | | | | | | | | * build-aux/gcc-warning.spec: Also list warnings that are default or are enabled by already-given flags. This lets us speed up checking for attributes, and makes the generated compilation commands shorter. Add -Wanalyzer-too-complex (too much noise). * m4/manywarnings.m4 (gl_MANYWARN_COMPLEMENT) (gl_MANYWARN_ALL_GCC): Use gl_AS_VAR_APPEND to append to shell variables that may have long values. (gl_MANYWARN_ALL_GCC): Omit flags that are default or are consequences of other flags, to speed up checking and shorten commands.
* manywarnings: port to GCC 10.1Paul Eggert2020-05-091-1/+23
| | | | | | * build-aux/gcc-warning.spec: * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C)): Add GCC 10.1.0 warnings.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* Port manywarnings to GCC 9Paul Eggert2019-05-031-2/+7
| | | | | | | | | | | | * build-aux/gcc-warning.spec: Sort. Add -Wattribute-alias, -Wc11-c2x-compat, -Wcast-result (for the D programming language), -Wclass-conversion, -Wdeprecated-copy, -Wdeprecated-copy-dtor, -Winit-list-lifetime, -Wpessimizing-move, -Wprio-ctor-dtor, -Wredundant-move. Adjust to minor wording changes in GCC 9’s --help=warnings output. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wabsolute-value, -Waddress-of-packed-member, -Wattribute-warning, -Wcannot-profile, -Wmissing-profile. Change -Wattribute-alias to -Wattribute-alias=2.
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* Make better use of Autoconf.Bruno Haible2018-10-121-40/+39
| | | | | | | | | | | | | * m4/environ.m4: Use AC_CACHE_CHECK where possible. * m4/manywarnings.m4: Likewise. * m4/manywarnings-c++.m4: Likewise. * m4/socklen.m4: Likewise. * m4/sockpfaf.m4: Likewise. * m4/stdarg.m4: Likewise. * m4/visibility.m4: Likewise. * m4/fsusage.m4: Use AC_CACHE_CHECK where possible. Modernize indentation. * m4/ls-mntd-fs.m4: Likewise.
* manywarnings: omit -Wswitch-defaultPaul Eggert2018-07-011-2/+1
| | | | | | | | | | | This should make things more consistent, as we already ignore -Wswitch-enum. Problem reported by Reuben Thomas; see: https://lists.gnu.org/r/bug-gnulib/2018-05/msg00179.html * build-aux/g++-warning.spec, build-aux/gcc-warning.spec: Add -Wswitch-default. * m4/manywarnings-c++.m4 (gl_MANYWARN_ALL_GCC_CXX_IMPL): * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Remove -Wswitch-default.
* manywarnings: Don't enable -Wjump-misses-init warnings by default.Bruno Haible2018-06-251-3/+2
| | | | | | * build-aux/gcc-warning.spec: Add -Wjump-misses-init. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C)): Remove -Wjump-misses-init.
* manywarnings: accommodate GCC 9.0-pre: remove -Wchkp and -WabiJim Meyering2018-06-241-2/+0
| | | | | | | | | | | * build-aux/gcc-warning.spec: Add them here, each with an explanation. * m4/manywarnings.m4: Remove them. Otherwise, building coreutils, I would see this: cc1: error: deprecated command line option '-Wchkp' [-Werror] cc1: error: -Wabi won't warn about anything [-Werror=abi] cc1: note: -Wabi warns about differences from the most up-to-date ABI,\ which is also used by default cc1: note: use e.g. -Wabi=11 to warn about changes from GCC 7
* manywarnings: port to GCC 8.0Paul Eggert2018-04-281-5/+15
| | | | | | | | | | | | | | | * build-aux/gcc-warning.spec: Add -Wcatch-value, -Wclass-memaccess, -Wdo-subscript, -Wextra-semi. Adjust to the fact that the GCC help message now mentions operands for -Warray-bounds, -Wformat, -Wformat-overflow, -Wformat-truncation, -Wimplicit-fallthrough, -Wplacement-new, -Wshift-overflow, -Wstrict-aliasing, -Wstrict-overflow, -Wstringop-overflow, and -Wunused-const-variable. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wattribute-alias, -Wcast-align=strict, -Wcast-function-type, -Wif-not-aligned, -Wmissing-attributes, -Wmultistatement-macros, -Wpacked-not-aligned, -Wsizeof-pointer-div, -Wstringop-truncation, -Wsuggest-attribute=cold, -Wsuggest-attribute=malloc.
* manywarnings: fix maintainer commentPaul Eggert2018-01-261-1/+1
| | | | | * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Fix comment so that it does not mistakenly think that ‘-1)’ is an option.
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* m4/manywarnings.m4: fix comment typo: s/reqirs/requires/Jim Meyering2017-09-171-1/+1
|
* manywarnings: port to GCC on 64-bit MS-WindowsPaul Eggert2017-09-161-6/+11
| | | | | | * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Work better if LONG_MAX < PTRDIFF_MAX. Problem reported by Richard Copley in: https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00392.html
* warnings: fix compilation with old autoconfEric Blake2017-08-241-3/+5
| | | | | | | | | | | | | | | | | | | Autoconf older than 2.63b (such as what ships on CentOS 6) had a bug that any AC_DEFUN'd macro name that includes shell meta- characters causes failure due to missing shell quoting during aclocal's use of autom4te. We can work around the problem by using m4_defun instead (same semantics in autom4te, but no longer traced by aclocal, so no longer tickles the shell quoting bug). * m4/warnings.m4 (gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)) (gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)): Use m4_defun rather than AC_DEFUN. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C)) (gl_MANYWARN_ALL_GCC(C++)): Likewise. Reported-by: Erik Skultety <eskultet@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
* manywarnings: Add support for C++.Reuben Thomas2017-08-071-1/+7
| | | | | | | | * build-aux/g++-warning.spec: New file. * m4/manywarnings-c++.m4: New file. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C++)): New macro, that redirects to manywarnings-c++.m4. * modules/manywarnings (Files): Add m4/manywarnings-c++.m4.
* warnings, manywarnings: Add support for multiple languages, not just C.Bruno Haible2017-08-071-1/+11
| | | | | | | | | | | | | | | * warnings.m4 (gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL): Renamed from gl_UNKNOWN_WARNINGS_ARE_ERRORS. (gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)): New macro. (gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)): New macro. (gl_UNKNOWN_WARNINGS_ARE_ERRORS): Dispatch to gl_UNKNOWN_WARNINGS_ARE_ERRORS(_AC_LANG). (gl_WARN_ADD): Require the gl_UNKNOWN_WARNINGS_ARE_ERRORS specialization of the current language. If C++ is the current language, modify WARN_CXXFLAGS instead of WARN_CFLAGS. * manywarnings.m4 (gl_MANYWARN_ALL_GCC(C)): New macro, extracted from gl_MANYWARN_ALL_GCC. (gl_MANYWARN_ALL_GCC): Dispatch to gl_MANYWARN_ALL_GCC(_AC_LANG).
* manywarnings: port to 64-bit GCC builds of EmacsPaul Eggert2017-08-041-4/+15
| | | | | | | | * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Compute max safe object size rather than hardwiring 2147483647. This is needed to build GNU Emacs, which has one conditional (and used only-in-theory) call to malloc with a literal greater than 2147483647.
* manywarnings: port to 32-bit GCC bugPaul Eggert2017-08-011-3/+3
| | | | | | | | Problem reported by Pino Toscano in: http://lists.gnu.org/archive/html/bug-gnulib/2017-07/msg00150.html * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Use 2**31 - 1, not 2**63 - 1, to work around the following GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81650
* manywarnings: update for GCC 7Paul Eggert2017-05-161-3/+22
| | | | | | | | | | | * build-aux/gcc-warning.spec: * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add GCC 7 warnings, notably -Wimplicit-fallthrough=5, which requires a non-comment fallthrough attribute. This is a bit cleaner than the comment versions. * lib/strftime.c, lib/dfa.c, lib/fnmatch.c, lib/mbrtowc.c: * lib/vasnprintf.c, tests/macros.h (FALLTHROUGH): New macro. Use it whenever one switch case falls through into the next.
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* manywarnings: fix -Wno-missing-field-initializers detectionFrediano Ziglio2016-11-091-1/+2
| | | | | | * m4/manywarnings.m4: Fix -Wno-missing-field-initializers detection to be independent of -Wunused-variable. I.E. ensure the latter warning doesn't occur so that detection of the former is accurate.
* manywarnings: add -fno-commonJim Meyering2016-09-021-0/+1
| | | | | | | | | | | * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -fno-common to the list. Quoting the manual, "Compiling with -fno-common is useful on targets for which it provides better performance, or if you wish to verify that the program will work on other systems that always treat uninitialized variable declarations this way [putting it in the data section]." If diffutils had been using this sooner, it would have prevented this duplicate declaration issue: http://git.sv.gnu.org/cgit/diffutils.git/commit/?id=v3.4-10-gc2dc91f
* manywarnings: update for GCC 6.1Paul Eggert2016-05-171-1/+13
| | | | | | | * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add GCC 6.1 options that apply to C. * build-aux/gcc-warning.spec: Add GCC 6.1 options that do not apply to C, are obsolescent, etc.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* manywarnings: add GCC 5.1 warningsPaul Eggert2015-04-241-3/+20
| | | | | | | | | | | | | | | | | * build-aux/gcc-warning.spec: Add -Wabi=, -Warray-bounds, -Warray-bounds=, -Wc++14-compat, -Wc90-c99-compat, -Wc99-c11-compat, -Wshadow-ivar, -Wsized-deallocation, -Wsuggest-override, -Wuse-without-only. Change -Wnormalized=... operands to match 5.1. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wbool-compare, -Wchkp, -Wdesignated-init, -Wdiscarded-array-qualifiers, -Wdiscarded-qualifiers, -Wformat-signedness, -Wincompatible-pointer-types, -Wint-conversion, -Wlogical-not-parentheses, -Wmemset-transposed-args, -Wodr, -Wshift-count-negative, -Wshift-count-overflow, -Wsizeof-array-argument, -Wsuggest-final-methods, -Wsuggest-final-types, -Wswitch-bool. Remove -Warray-bounds, and add -Warray-bounds=2 as a special case.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* manywarnings: add GCC 4.9 warningsPaul Eggert2014-09-011-4/+26
| | | | | | | | | | | | | Also, make it easier to maintain this in the future. * build-aux/gcc-warning.spec: Add -Wabi-tag, -Wconditionally-supported, -Wdelete-incomplete, -Winherited-variadic-ctor, -Wvirtual-move-assign, -Wzerotrip. Remove duplicates. Use tabs uniformly, as that's what 'cut' wants. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wdate-time, -Wopenmp-simd. Use -fdiagnostics-show-option and -funit-at-a-time only for older GCC versions that need them. Handke -Wnormalized=nfc specially, so that the 'comm' command used for maintenance doesn't get confused.
* manywarnings: remove -WmudflapJim Meyering2014-01-021-1/+0
| | | | | * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Remove -Wmudflap, since it is no longer supported in gcc-4.9-to-be.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* manywarnings: enable nicer gcc warning messagesEric Blake2013-09-241-1/+3
| | | | | | | | | | | | | | | | | | With gcc 4.3.4, -Wdisabled-optimization is noisy unless you also use -funit-at-a-time. With gcc 4.4.7, there is no indication which warning option triggered a particular message unless you also use -fdiagnostics-show-option. Both of these options are default in newer gcc (such as 4.8.1); but including them in the list of possible warnings makes the experience nicer on older platforms. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Older gcc requires some -f options for optimal warnings. Signed-off-by: Eric Blake <eblake@redhat.com>
* manywarnings: update for GCC 4.8.0Paul Eggert2013-05-151-4/+2
| | | | | | | | | * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Waggressive-loop-optimizations, -Wreturn-local-addr, which are new to GCC 4.8. Remove -Wformat=2, -Wmissing-format-attribute, -Wmissing-noreturn, as they are duplicates of other warnings. Remove -Wunreachable-code, as it is removed in GCC 4.8 and was documented to be flaky in earlier versions of GCC.
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* manywarnings: cater to more gcc infelicitiesEric Blake2012-10-021-7/+25
| | | | | | | | | | | | | | Some versions of gcc (at least 4.2.1) noisily warn if -Wuninitialized is given without -O; in isolation, configure learns that the warning option is supported, but when later compiling with -Werror, this makes builds fail. If the option will have no effect for the configured choice of $CFLAGS, then it is not worth including in the set. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add test for -Wuninitialized without -O. Signed-off-by: Eric Blake <eblake@redhat.com>
* manywarnings: update the list of "all" warningsJim Meyering2012-09-021-65/+88
| | | | | | | | | | | | | * m4/manywarnings.m4: Unite lists, and add many new options. * build-aux/gcc-warning: New file. Run this command with the latest gcc to see if they have added options not yet on our list: gl=.; comm -1 -3 \ <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' $gl/m4/manywarnings.m4 |sort) \ <(gcc --help=warnings|sed -n 's/^ \(-[^ ]*\) .*/\1/p' |sort \ |grep -v --line-regexp -f <(cut -f1 $gl/build-aux/gcc-warning.spec))
* manywarnings: remove duplicate -Wmultichar entryPaul Eggert2012-05-271-2/+1
| | | | | | * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Remove duplicate entry for -Wmultichar. -Wno-multichar is in the GCC 4.7.0 manual, so keep the entry marked as documented.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* manywarnings: Don't mention gcc version in docstring.Simon Josefsson2011-11-301-4/+4
| | | | | * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Doc fix. Suggested by Jim Meyering <meyering@redhat.com>.
* manywarnings: drop -Wunsuffixed-float-constantsEric Blake2011-11-291-2/+1
| | | | | | | * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): C99 does not allow '1.0D', which is the only way to silence this warning for 'double'. Signed-off-by: Eric Blake <eblake@redhat.com>
* manywarnings: More warnings.Simon Josefsson2011-11-201-0/+27
| | | | * m4/manywarnings.m4: Add more warnings from gcc 4.6.2.