Now don’t get me wrong, I love to use GNU make on all the unixoid platforms where I have to use it and I have been using it for some advanced stuff on Windows as well. But honestly, when has someone tried to compile this on Windows the last time? And moreover has anyone noticed the abundance of warnings?
Guess not. And I was merely trying to create a binary for myself and others who’d want to download it. I didn’t realize it was going to be such a PITA.
Implicit conversions between time_t and int or char and int all over the place, assumptions about the signedness of size_t and the like. What’s annoying about particularly the latter one is that a consistent use of size_t would avoid these warnings.
Oh, and has anyone by any chance noticed the horrible mix of tabs and spaces? What’s the default tab-width the author(s) are using? Is there even one?
Not to mention the hackery concerning time_t w.r.t. 64-bit 🙄 …
After looking at the source code I have my doubts whether it is a good choice to use this, despite all the wicked-cool features GNU make has compared to other Make flavors. Even in much bigger code bases I’ve seen my share of warnings across the many supported compilers, but not quite as extensively as in this case.
All of this reminds me of code I sometimes see from a programmer who learned his skills in the 1980s but hasn’t really kept up … 😐
// Oliver
Exhibit A (using the GNU make 3.82 code with VS 2010):
warning C4244:'=' : conversion from 'int' to 'char', possible loss of data commands.c 435warning C4244:'=' : conversion from 'time_t' to 'int', possible loss of data dir.c 499warning C4244:'=' : conversion from 'time_t' to 'int', possible loss of data dir.c 523warning C4244:'=' : conversion from 'time_t' to 'int', possible loss of data dir.c 524warning C4244:'=' : conversion from 'size_t' to 'short', possible loss of data dir.c 626warning C4244:'=' : conversion from 'time_t' to 'int', possible loss of data dir.c 647warning C4244:'=' : conversion from 'time_t' to 'int', possible loss of data dir.c 653warning C4244:'=' : conversion from 'unsigned int' to 'short', possible loss of data dir.c 700warning C4244:'=' : conversion from 'unsigned int' to 'short', possible loss of data dir.c 716warning C4244:'=' : conversion from 'size_t' to 'short', possible loss of data dir.c 885warning C4244:'=' : conversion from 'size_t' to 'short', possible loss of data dir.c 969warning C4307:'+' : integral constant overflow file.c 797warning C4307:'+' : integral constant overflow file.c 798warning C4307:'+' : integral constant overflow file.c 801warning C4244:'=' : conversion from 'int' to 'unsigned char', possible loss of data function.c 278warning C4130:'==' : logical operation on address of string constant function.c 528warning C4130:'==' : logical operation on address of string constant function.c 552warning C4130:'==' : logical operation on address of string constant function.c 585warning C4130:'==' : logical operation on address of string constant function.c 637warning C4130:'==' : logical operation on address of string constant function.c 922warning C4244:'=' : conversion from 'int' to 'char', possible loss of data function.c 1033warning C4115:'token' : named type definition in parentheses hash.c 46warning C4115:'token' : named type definition in parentheses hash.c 262warning C4244:'=' : conversion from 'int' to 'char', possible loss of data implicit.c 408warning C4389:'==' : signed/unsigned mismatch job.c 749warning C4130:'==' : logical operation on address of string constant main.c 1090warning C4130:'==' : logical operation on address of string constant main.c 1200warning C4130:'==' : logical operation on address of string constant main.c 1211warning C4210:nonstandard extension used : function given file scope main.c 1582warning C4244:'=' : conversion from 'const int' to 'char', possible loss of data main.c 2348warning C4244:'=' : conversion from 'const int' to 'char', possible loss of data main.c 2558warning C4244:'=' : conversion from 'const int' to 'char', possible loss of data main.c 2898warning C4389:'==' : signed/unsigned mismatch misc.c 207warning C4130:'==' : logical operation on address of string constant read.c 1960warning C4130:'==' : logical operation on address of string constant read.c 1965warning C4245:'return' : conversion from 'int' to 'unsigned long', signed/unsigned mismatch read.c 2320warning C4210:nonstandard extension used : function given file scope read.c 2855warning C4307:'+' : integral constant overflow remake.c 475warning C4244:'=' : conversion from 'int' to 'short', possible loss of data remake.c 665warning C4244:'=' : conversion from 'int' to 'short', possible loss of data remake.c 882warning C4701:potentially uninitialized local variable 'best_vpath' used remake.c 1601warning C4701:potentially uninitialized local variable 'best_path' used remake.c 1601warning C4701:potentially uninitialized local variable 'status' used main.c 2309warning C4701:potentially uninitialized local variable 'coredump' used job.c 787warning C4701:potentially uninitialized local variable 'exit_sig' used job.c 737warning C4701:potentially uninitialized local variable 'exit_code' used job.c 737warning C4701:potentially uninitialized local variable 'ri' used implicit.c 816warning C4706:assignment within conditional expression function.c 693warning C4706:assignment within conditional expression function.c 2238warning C4706:assignment within conditional expression function.c 2262warning C4244:'=' : conversion from 'int' to 'char', possible loss of data rule.c 384warning C4244:'=' : conversion from 'unsigned int' to 'unsigned short', possible loss of data rule.c 454warning C4244:'=' : conversion from 'int' to 'char', possible loss of data rule.c 469warning C4244:'=' : conversion from 'int' to 'char', possible loss of data signame.c 245warning C4130:'==' : logical operation on address of string constant variable.c 365warning C4130:'==' : logical operation on address of string constant variable.c 1016warning C4130:'==' : logical operation on address of string constant variable.c 1087warning C4130:'==' : logical operation on address of string constant variable.c 1284warning C4090:'function' : different 'const' qualifiers vpath.c 282warning C4244:'=' : conversion from 'int' to 'unsigned char', possible loss of data glob\fnmatch.c 177warning C4244:'=' : conversion from 'int' to 'unsigned char', possible loss of data glob\fnmatch.c 199warning C4244:'=' : conversion from 'int' to 'unsigned char', possible loss of data glob\fnmatch.c 274warning C4244:'initializing' : conversion from 'int' to 'unsigned char', possible loss of data glob\fnmatch.c 321warning C4244:'=' : conversion from 'int' to 'unsigned char', possible loss of data glob\fnmatch.c 327warning C4389:'!=' : signed/unsigned mismatch glob\glob.c 499warning C4018:'<' : signed/unsigned mismatch glob\glob.c 870warning C4389:'==' : signed/unsigned mismatch glob\glob.c 921warning C4018:'<' : signed/unsigned mismatch glob\glob.c 948warning C4018:'<' : signed/unsigned mismatch glob\glob.c 1010warning C4018:'<' : signed/unsigned mismatch glob\glob.c 1028warning C4018:'>' : signed/unsigned mismatch glob\glob.c 1051warning C4018:'<' : signed/unsigned mismatch glob\glob.c 1071warning C4244:'=' : conversion from 'int' to 'char', possible loss of data glob\glob.c 1155warning C4706:assignment within conditional expression w32\pathstuff.c 69warning C4701:potentially uninitialized local variable 'origin' used variable.c 1566