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