bugmake - Bugs: bug #56895, Cannot build make due to compiler...


bug #56895: Cannot build make due to compiler warnings/failures

Submitted by:  David A. Wheeler <dwheeler>
Submitted on:  Sun 15 Sep 2019 03:32:15 AM UTC  
Severity:  3 - Normal Item Group:  Build/Install
Status:  Fixed Privacy:  Public
Assigned to:  Paul D. Smith <psmith> Open/Closed:  Closed
Component Version:  4.3 Operating System:  Any
Fixed Release:  4.3 Triage Status:  Small Effort

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Mon 16 Sep 2019 06:09:11 PM UTC, comment #4: 

Excellent, I will check it out (literally). Thank you!

David A. Wheeler <dwheeler>
Mon 16 Sep 2019 12:35:05 PM UTC, comment #3: 

I pushed changes to git that should fix some compile issues and also some docs to README.git with more advice for compiling from git.

To build a "final" GNU make from Git on a system which doesn't have a full GNU environment, you can use:


Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Sun 15 Sep 2019 07:17:19 PM UTC, comment #2: 

I think the fall through in read.c is incorrect.  I think this code is broken when HAVE_DOS_PATHS is set.  I can't see any justification for falling through into the variable case if we find a ":" in a drive spec.

If we detect a ":" in a drive spec, we should be using break here to get to the next character in the word.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Sun 15 Sep 2019 06:24:06 PM UTC, comment #1: 

The failure for find_in_given_path() is because one version of that function was pushed to gnulib, then I pushed my changes to use it to GNU make, then another version of that function with a different calling signature was pushed to gnulib so if you use gnulib HEAD it won't compile anymore.

I have a fix but I'm working through some more details on how this function should work with Bruno.  Should push today.

The compile errors for getopt I'm not excited about applying because getopt, like glob, are shipped with GNU make but not actually part of GNU make.

I added some comments in README.git that recommend compiling with MAKE_CFLAGS= on the make command line if you don't have a fully modern GCC/GNU lib/etc. system.

I will look at the read.c change.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Sun 15 Sep 2019 03:32:15 AM UTC, original submission:  

Compilation of the current git commit 271e572ba2f16f8d5b1d45c768bdec060073c279 dated Tue Sep 10 19:09:39 2019 +0300 fails on Cygwin, and probably many other systems, because the latest gcc reports warnings that because of -WError become compilation failures.

This affects these files:

  • src/getopt.c
  • src/job.c
  • lib/findprog.h

Running "gcc --version" reports:
gcc (GCC) 7.4.0

To get to this point, simply "git clone" the current version onto Cygwin (and probably other systems) and try to:
./bootstrap && ./configure && make check

Below is the relevant extract of the failure report (I had to remove -WError to get it to run all the way to the final failure):

make[1]: Entering directory '/home/dwheeler/make'
depbase=`echo src/getopt.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H   -Isrc -I./src -Ilib -I./lib -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DLOCALEDIR=\"/usr/local/share/locale\"  -DMAKE_MAINTAINER_MODE   -C -Wall -Wextra -Wwrite-strings -Wshadow -Wdeclaration-after-statement -Wbad-function-cast -Wformat-security -Wtype-limits -Wunused-but-set-parameter -Wlogical-op -Wpointer-arith -Wignored-qualifiers -Wformat-signedness -Wduplicated-cond -g -O2 -MT src/getopt.o -MD -MP -MF $depbase.Tpo -c -o src/getopt.o src/getopt.c &&\
mv -f $depbase.Tpo $depbase.Po

src/getopt.c: In function ‘_getopt_initialize’:
src/getopt.c:380:25: warning: unused parameter ‘argc’ [-Wunused-parameter]
 _getopt_initialize (int argc, char const argv, const char *optstring)
src/getopt.c:380:44: warning: unused parameter ‘argv’ [-Wunused-parameter]
 _getopt_initialize (int argc, char const argv, const char *optstring)
src/getopt.c: In function ‘_getopt_internal’:
src/getopt.c:679:8: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
     if (opterr)


depbase=`echo src/job.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H   -Isrc -I./src -Ilib -I./lib -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DLOCALEDIR=\"/usr/local/share/locale\"  -DMAKE_MAINTAINER_MODE   -C -Wall -Wextra -Wwrite-strings -Wshadow -Wdeclaration-after-statement -Wbad-function-cast -Wformat-security -Wtype-limits -Wunused-but-set-parameter -Wlogical-op -Wpointer-arith -Wignored-qualifiers -Wformat-signedness -Wduplicated-cond -g -O2 -MT src/job.o -MD -MP -MF $depbase.Tpo -c -o src/job.o src/job.c &&\
mv -f $depbase.Tpo $depbase.Po
src/job.c: In function ‘child_execute_job’:
src/job.c:2374:19: error: too few arguments to function ‘find_in_given_path’
     cmd = (char *)find_in_given_path (argv[0], p);
In file included from src/job.c:141:0:
lib/findprog.h:52:20: note: declared here
 extern const char find_in_given_path (const char progname, const char *path,
make[1]: *** [Makefile:1341: src/job.o] Error 1
make[1]: Leaving directory '/home/dwheeler/make'
make: *** [Makefile:1427: all-recursive] Error 1

David A. Wheeler <dwheeler>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #47521:  ,trivial-compile-fixes added by dwheeler (2KiB - application/octet-stream - Diffs to correct problems)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by dwheeler (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-09-16 psmith StatusNone => Fixed
        Assigned toNone => psmith
        Open/ClosedOpen => Closed
        Fixed ReleaseNone => 4.3
        Triage StatusNone => Small Effort
    2019-09-15 dwheeler Attached File- => Added ,trivial-compile-fixes, #47521

    Back to the top

    Powered by Savane 3.7