Unified · Split
| @@ -181,7 +181,14 @@ Undefine preprocessor symbol @samp{sym}. · 180 unmodified lines | |||
| 181 | 181 | ||
| 182 | Warning options: | 182 | Warning options: |
| 183 | 183 | ||
| 184 | Note: each warning option has a negative form beginning with @option{-Wno-}. | 184 | @table @option |
| 185 | @item -w | ||
| 186 | Disable all warnings. | ||
| 187 | |||
| 188 | @end table | ||
| 189 | |||
| 190 | Note: each of the following warning options has a negative form beginning with | ||
| 191 | @option{-Wno-}. | ||
| 185 | 192 | ||
| 186 | @table @option | 193 | @table @option |
| 187 | @item -Wunsupported | 194 | @item -Wunsupported |
| @@ -604,7 +611,7 @@ executable ELF files and dynamic ELF libraries without relying on an · 416 unmodified lines | |||
| 604 | external linker. | 611 | external linker. |
| 605 | 612 | ||
| 606 | Dynamic ELF libraries can be output but the C compiler does not generate | 613 | Dynamic ELF libraries can be output but the C compiler does not generate |
| 607 | position independent code (PIC). It means that the dynamic librairy | 614 | position independent code (PIC). It means that the dynamic library |
| 608 | code generated by TCC cannot be factorized among processes yet. | 615 | code generated by TCC cannot be factorized among processes yet. |
| 609 | 616 | ||
| 610 | TCC linker eliminates unreferenced object code in libraries. A single pass is | 617 | TCC linker eliminates unreferenced object code in libraries. A single pass is |
| @@ -408,7 +408,8 @@ struct TCCState { · 407 unmodified lines | |||
| 408 | int warn_write_strings; | 408 | int warn_write_strings; |
| 409 | int warn_unsupported; | 409 | int warn_unsupported; |
| 410 | int warn_error; | 410 | int warn_error; |
| 411 | 411 | int warn_none; | |
| 412 | |||
| 412 | /* error handling */ | 413 | /* error handling */ |
| 413 | void *error_opaque; | 414 | void *error_opaque; |
| 414 | void (*error_func)(void *opaque, const char *msg); | 415 | void (*error_func)(void *opaque, const char *msg); |
| @@ -1238,6 +1239,9 @@ void warning(const char *fmt, ...) · 823 unmodified lines | |||
| 1238 | TCCState *s1 = tcc_state; | 1239 | TCCState *s1 = tcc_state; |
| 1239 | va_list ap; | 1240 | va_list ap; |
| 1240 | 1241 | ||
| 1242 | if (s1->warn_none) | ||
| 1243 | return; | ||
| 1244 | |||
| 1241 | va_start(ap, fmt); | 1245 | va_start(ap, fmt); |
| 1242 | error1(s1, 1, fmt, ap); | 1246 | error1(s1, 1, fmt, ap); |
| 1243 | va_end(ap); | 1247 | va_end(ap); |
| @@ -9551,16 +9555,6 @@ int tcc_set_warning(TCCState *s, const char *warning_name, int value) · 8307 unmodified lines | |||
| 9551 | 9555 | ||
| 9552 | #if !defined(LIBTCC) | 9556 | #if !defined(LIBTCC) |
| 9553 | 9557 | ||
| 9554 | static void tcc_reset_warnings(TCCState *s) | ||
| 9555 | { | ||
| 9556 | int i; | ||
| 9557 | const WarningDef *p; | ||
| 9558 | |||
| 9559 | for(i = 0, p = warning_defs; i < countof(warning_defs); i++, p++) { | ||
| 9560 | *(int *)((uint8_t *)s + p->offset) = 0; | ||
| 9561 | } | ||
| 9562 | } | ||
| 9563 | |||
| 9564 | /* extract the basename of a file */ | 9558 | /* extract the basename of a file */ |
| 9565 | static const char *tcc_basename(const char *name) | 9559 | static const char *tcc_basename(const char *name) |
| 9566 | { | 9560 | { |
| @@ -9872,7 +9866,7 @@ int main(int argc, char **argv) · 305 unmodified lines | |||
| 9872 | } | 9866 | } |
| 9873 | break; | 9867 | break; |
| 9874 | case TCC_OPTION_w: | 9868 | case TCC_OPTION_w: |
| 9875 | tcc_reset_warnings(s); | 9869 | s->warn_none = 1; |
| 9876 | break; | 9870 | break; |
| 9877 | case TCC_OPTION_rdynamic: | 9871 | case TCC_OPTION_rdynamic: |
| 9878 | s->rdynamic = 1; | 9872 | s->rdynamic = 1; |