|
70 | 70 | push(@lflags, $arg);
|
71 | 71 | } elsif ("$arg" =~ /^-[Rl]/) {
|
72 | 72 | # eat
|
| 73 | + } elsif ("$arg" eq "-Werror") { |
| 74 | + push(@cflags, "-WX"); |
| 75 | + } elsif ("$arg" eq "-Wall") { |
| 76 | + # cl.exe understands -Wall, but it is really overzealous |
| 77 | + push(@cflags, "-W4"); |
| 78 | + # disable the "signed/unsigned mismatch" warnings; our source code violates that |
| 79 | + push(@cflags, "-wd4018"); |
| 80 | + push(@cflags, "-wd4245"); |
| 81 | + push(@cflags, "-wd4389"); |
| 82 | + # disable the "unreferenced formal parameter" warning; our source code violates that |
| 83 | + push(@cflags, "-wd4100"); |
| 84 | + # disable the "conditional expression is constant" warning; our source code violates that |
| 85 | + push(@cflags, "-wd4127"); |
| 86 | + # disable the "const object should be initialized" warning; these warnings affect only objects that are `static` |
| 87 | + push(@cflags, "-wd4132"); |
| 88 | + # disable the "function/data pointer conversion in expression" warning; our source code violates that |
| 89 | + push(@cflags, "-wd4152"); |
| 90 | + # disable the "non-constant aggregate initializer" warning; our source code violates that |
| 91 | + push(@cflags, "-wd4204"); |
| 92 | + # disable the "cannot be initialized using address of automatic variable" warning; our source code violates that |
| 93 | + push(@cflags, "-wd4221"); |
| 94 | + # disable the "possible loss of data" warnings; our source code violates that |
| 95 | + push(@cflags, "-wd4244"); |
| 96 | + push(@cflags, "-wd4267"); |
| 97 | + # disable the "array is too small to include a terminating null character" warning; we ab-use strings to initialize OIDs |
| 98 | + push(@cflags, "-wd4295"); |
| 99 | + # disable the "'<<': result of 32-bit shift implicitly converted to 64 bits" warning; our source code violates that |
| 100 | + push(@cflags, "-wd4334"); |
| 101 | + # disable the "declaration hides previous local declaration" warning; our source code violates that |
| 102 | + push(@cflags, "-wd4456"); |
| 103 | + # disable the "declaration hides function parameter" warning; our source code violates that |
| 104 | + push(@cflags, "-wd4457"); |
| 105 | + # disable the "declaration hides global declaration" warning; our source code violates that |
| 106 | + push(@cflags, "-wd4459"); |
| 107 | + # disable the "potentially uninitialized local variable '<name>' used" warning; our source code violates that |
| 108 | + push(@cflags, "-wd4701"); |
| 109 | + # disable the "unreachable code" warning; our source code violates that |
| 110 | + push(@cflags, "-wd4702"); |
| 111 | + # disable the "potentially uninitialized local pointer variable used" warning; our source code violates that |
| 112 | + push(@cflags, "-wd4703"); |
| 113 | + # disable the "assignment within conditional expression" warning; our source code violates that |
| 114 | + push(@cflags, "-wd4706"); |
| 115 | + # disable the "'inet_ntoa': Use inet_ntop() or InetNtop() instead" warning; our source code violates that |
| 116 | + push(@cflags, "-wd4996"); |
| 117 | + } elsif ("$arg" =~ /^-W[a-z]/) { |
| 118 | + # let's ignore those |
73 | 119 | } else {
|
74 | 120 | push(@args, $arg);
|
75 | 121 | }
|
|
0 commit comments