bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

minor glitches in make 4.1.90 found by GCC warning flags


From: Paul Eggert
Subject: minor glitches in make 4.1.90 found by GCC warning flags
Date: Wed, 27 Apr 2016 08:45:29 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0

Attached is a patch that fixes the following minor glitches that I found when building GNU Make 4.1.90 with GCC warnings enabled:

Use 'unsigned int', not 'int' for modes printed via %o, as GCC warns
when printing a signed value with %o (is this undefined behavior?).

Rename ar.c's glob_pattern_p to ar_glob_pattern_p to avoid confusion
with glob.h's definition of the same symbol, needed now that makeint.h
includes glob.h (see below).

Remove unused macros PORTAR, FILE_BUCKETS, REALLOC, CLONE.

Move declarations of extern functions into .h files, so that they are
automatically checked for consistency against their definitions.
Since one of these functions uses glob_t, this entails having
makeint.h include glob.h.

Do not redeclare system functions like 'stat'.

Remove multiple declarations of suffix_file.

The functions 'func_shell' and 'shell_result' are now static.

Use %u, not %d, to print unsigned integers.

In getloadavg.c, use the same rule for defining 'setlocale' that
is already used elsewhere.

In getopt1.c, include getopt.h after including stdio.h, so that
getopt.h's use of __GNU_LIBRARY__ has the intended effect.

Remove unused macro _NO_PROTO in getopt.c.  This is no longer needed
anyway, as OSF/1 (obsolete since 1995) and AIX 3.2 (1992) are long dead.

Remove declarations of getenv.  We can safely assume C89 now.

In job.c, remove duplicate inclusion of debug.h.

Declare getloadavg and getcwd only on systems that lack them.

Use function prototypes even for functions that have no arguments, as
the prototype-free versions aren't checked as well.

Remove duplicate declaration of print_file_variables.


Here is the command line that I used to discover the above issues, on Fedora 23:

make CFLAGS='-g -O2 -Werror -W -Wabi -Waddress -Waggressive-loop-optimizations -Wall -Wattributes -Wbool-compare -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wchkp -Wclobbered -Wcomment -Wcomments -Wcoverage-mismatch -Wcpp -Wdate-time -Wdeprecated -Wdeprecated-declarations -Wdesignated-init -Wdisabled-optimization -Wdiscarded-array-qualifiers -Wdiscarded-qualifiers -Wdiv-by-zero -Wdouble-promotion -Wempty-body -Wendif-labels -Wenum-compare -Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-signedness -Wformat-y2k -Wformat-zero-length -Wfree-nonheap-object -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wincompatible-pointer-types -Winit-self -Wint-conversion -Wint-to-pointer-cast -Winvalid-memory-model -Winvalid-pch -Wjump-misses-init -Wlogical-not-parentheses -Wlogical-op -Wmain -Wmaybe-uninitialized -Wmemset-transposed-args -Wmissing-braces -Wmissing-declarations -Wmissing-include-dirs -Wmissing-parameter-type -Wmissing-prototypes -Wmultichar -Wnarrowing -Wnested-externs -Wnonnull -Wodr -Wold-style-declaration -Wold-style-definition -Wopenmp-simd -Woverflow -Woverride-init -Wpacked -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-sign -Wpointer-to-int-cast -Wpragmas -Wreturn-local-addr -Wreturn-type -Wsequence-point -Wshift-count-negative -Wshift-count-overflow -Wsizeof-array-argument -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstrict-prototypes -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wsuggest-final-methods -Wsuggest-final-types -Wswitch-bool -Wtrampolines -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function -Wunused-label -Wunused-local-typedefs -Wunused-macros -Wunused-result -Wunused-value -Wunused-variable -Wvarargs -Wvariadic-macros -Wvector-operation-performance -Wvolatile-register-var -Wwrite-strings -Warray-bounds=2 -Wnormalized=nfc -Wno-missing-field-initializers -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-format-nonliteral -Wredundant-decls'

Attachment: make-4.1.90.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]