I’m blind (I think)

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):

  1. warning C4244: '=' : conversion from 'int' to 'char', possible loss of data commands.c 435
  2. warning C4244: '=' : conversion from 'time_t' to 'int', possible loss of data dir.c 499
  3. warning C4244: '=' : conversion from 'time_t' to 'int', possible loss of data dir.c 523
  4. warning C4244: '=' : conversion from 'time_t' to 'int', possible loss of data dir.c 524
  5. warning C4244: '=' : conversion from 'size_t' to 'short', possible loss of data dir.c 626
  6. warning C4244: '=' : conversion from 'time_t' to 'int', possible loss of data dir.c 647
  7. warning C4244: '=' : conversion from 'time_t' to 'int', possible loss of data dir.c 653
  8. warning C4244: '=' : conversion from 'unsigned int' to 'short', possible loss of data dir.c 700
  9. warning C4244: '=' : conversion from 'unsigned int' to 'short', possible loss of data dir.c 716
  10. warning C4244: '=' : conversion from 'size_t' to 'short', possible loss of data dir.c 885
  11. warning C4244: '=' : conversion from 'size_t' to 'short', possible loss of data dir.c 969
  12. warning C4307: '+' : integral constant overflow file.c 797
  13. warning C4307: '+' : integral constant overflow file.c 798
  14. warning C4307: '+' : integral constant overflow file.c 801
  15. warning C4244: '=' : conversion from 'int' to 'unsigned char', possible loss of data function.c 278
  16. warning C4130: '==' : logical operation on address of string constant function.c 528
  17. warning C4130: '==' : logical operation on address of string constant function.c 552
  18. warning C4130: '==' : logical operation on address of string constant function.c 585
  19. warning C4130: '==' : logical operation on address of string constant function.c 637
  20. warning C4130: '==' : logical operation on address of string constant function.c 922
  21. warning C4244: '=' : conversion from 'int' to 'char', possible loss of data function.c 1033
  22. warning C4115: 'token' : named type definition in parentheses hash.c 46
  23. warning C4115: 'token' : named type definition in parentheses hash.c 262
  24. warning C4244: '=' : conversion from 'int' to 'char', possible loss of data implicit.c 408
  25. warning C4389: '==' : signed/unsigned mismatch job.c 749
  26. warning C4130: '==' : logical operation on address of string constant main.c 1090
  27. warning C4130: '==' : logical operation on address of string constant main.c 1200
  28. warning C4130: '==' : logical operation on address of string constant main.c 1211
  29. warning C4210: nonstandard extension used : function given file scope main.c 1582
  30. warning C4244: '=' : conversion from 'const int' to 'char', possible loss of data main.c 2348
  31. warning C4244: '=' : conversion from 'const int' to 'char', possible loss of data main.c 2558
  32. warning C4244: '=' : conversion from 'const int' to 'char', possible loss of data main.c 2898
  33. warning C4389: '==' : signed/unsigned mismatch misc.c 207
  34. warning C4130: '==' : logical operation on address of string constant read.c 1960
  35. warning C4130: '==' : logical operation on address of string constant read.c 1965
  36. warning C4245: 'return' : conversion from 'int' to 'unsigned long', signed/unsigned mismatch read.c 2320
  37. warning C4210: nonstandard extension used : function given file scope read.c 2855
  38. warning C4307: '+' : integral constant overflow remake.c 475
  39. warning C4244: '=' : conversion from 'int' to 'short', possible loss of data remake.c 665
  40. warning C4244: '=' : conversion from 'int' to 'short', possible loss of data remake.c 882
  41. warning C4701: potentially uninitialized local variable 'best_vpath' used remake.c 1601
  42. warning C4701: potentially uninitialized local variable 'best_path' used remake.c 1601
  43. warning C4701: potentially uninitialized local variable 'status' used main.c 2309
  44. warning C4701: potentially uninitialized local variable 'coredump' used job.c 787
  45. warning C4701: potentially uninitialized local variable 'exit_sig' used job.c 737
  46. warning C4701: potentially uninitialized local variable 'exit_code' used job.c 737
  47. warning C4701: potentially uninitialized local variable 'ri' used implicit.c 816
  48. warning C4706: assignment within conditional expression function.c 693
  49. warning C4706: assignment within conditional expression function.c 2238
  50. warning C4706: assignment within conditional expression function.c 2262
  51. warning C4244: '=' : conversion from 'int' to 'char', possible loss of data rule.c 384
  52. warning C4244: '=' : conversion from 'unsigned int' to 'unsigned short', possible loss of data rule.c 454
  53. warning C4244: '=' : conversion from 'int' to 'char', possible loss of data rule.c 469
  54. warning C4244: '=' : conversion from 'int' to 'char', possible loss of data signame.c 245
  55. warning C4130: '==' : logical operation on address of string constant variable.c 365
  56. warning C4130: '==' : logical operation on address of string constant variable.c 1016
  57. warning C4130: '==' : logical operation on address of string constant variable.c 1087
  58. warning C4130: '==' : logical operation on address of string constant variable.c 1284
  59. warning C4090: 'function' : different 'const' qualifiers vpath.c 282
  60. warning C4244: '=' : conversion from 'int' to 'unsigned char', possible loss of data glob\fnmatch.c 177
  61. warning C4244: '=' : conversion from 'int' to 'unsigned char', possible loss of data glob\fnmatch.c 199
  62. warning C4244: '=' : conversion from 'int' to 'unsigned char', possible loss of data glob\fnmatch.c 274
  63. warning C4244: 'initializing' : conversion from 'int' to 'unsigned char', possible loss of data glob\fnmatch.c 321
  64. warning C4244: '=' : conversion from 'int' to 'unsigned char', possible loss of data glob\fnmatch.c 327
  65. warning C4389: '!=' : signed/unsigned mismatch glob\glob.c 499
  66. warning C4018: '<' : signed/unsigned mismatch glob\glob.c 870
  67. warning C4389: '==' : signed/unsigned mismatch glob\glob.c 921
  68. warning C4018: '<' : signed/unsigned mismatch glob\glob.c 948
  69. warning C4018: '<' : signed/unsigned mismatch glob\glob.c 1010
  70. warning C4018: '<' : signed/unsigned mismatch glob\glob.c 1028
  71. warning C4018: '>' : signed/unsigned mismatch glob\glob.c 1051
  72. warning C4018: '<' : signed/unsigned mismatch glob\glob.c 1071
  73. warning C4244: '=' : conversion from 'int' to 'char', possible loss of data glob\glob.c 1155
  74. warning C4706: assignment within conditional expression w32\pathstuff.c 69
  75. warning C4701: potentially uninitialized local variable 'origin' used variable.c 1566
This entry was posted in C/C++, EN, Programming, Software, Thoughts and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *