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

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Makoto Kato
URL:
  <https://savannah.gnu.org/bugs/?56895>

                 Summary: Cannot build make due to compiler warnings/failures
                 Project: make
            Submitted by: dwheeler
            Submitted on: Sun 15 Sep 2019 03:32:15 AM UTC
                Severity: 3 - Normal
              Item Group: Build/Install
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: SCM
        Operating System: Any
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

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





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56895>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

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

Makoto Kato
Additional Item Attachment, bug #56895 (project make):

File name: ,trivial-compile-fixes         Size:2 KB
    <https://savannah.gnu.org/file/,trivial-compile-fixes?file_id=47521>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56895>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

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

Makoto Kato
Follow-up Comment #1, bug #56895 (project make):

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.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56895>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

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

Makoto Kato
Follow-up Comment #2, bug #56895 (project make):

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.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56895>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

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

David A. Wheeler
Ah, ok, I had assumed the fallthrough was intentional. Looks like the warning found a real bug.

As far as the other changes go, dealing with them some other way would be great. I just needed to be able to compile the code.
--- David A.Wheeler
_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

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

Makoto Kato
In reply to this post by Makoto Kato
Update of bug #56895 (project make):

                  Status:                    None => Fixed                  
             Assigned to:                    None => psmith                
             Open/Closed:                    Open => Closed                
           Fixed Release:                    None => SCM                    
           Triage Status:                    None => Small Effort          

    _______________________________________________________

Follow-up 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:


  make MAKE_MAINTAINER_MODE= MAKE_CFLAGS=


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56895>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

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

Makoto Kato
Follow-up Comment #4, bug #56895 (project make):

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

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56895>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make