History

fixed -w option - doc update (thanx to Romain Francoise)

bellard committed 23 years ago

Commit c5ce5ea1 parent 9c1106d2 files · +15 −14Browse files

Unified · Split

2 files
  1. tcc-doc.texi +9 −2
  2. tcc.c +6 −12
tcc-doc.texi+9−2
@@ -181,7 +181,14 @@ Undefine preprocessor symbol @samp{sym}. · 180 unmodified lines
181181
182182 Warning options:
183183
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-}.
185192
186193 @table @option
187194 @item -Wunsupported
@@ -604,7 +611,7 @@ executable ELF files and dynamic ELF libraries without relying on an · 416 unmodified lines
604611 external linker.
605612
606613 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
608615 code generated by TCC cannot be factorized among processes yet.
609616
610617 TCC linker eliminates unreferenced object code in libraries. A single pass is
tcc.c+6−12
@@ -408,7 +408,8 @@ struct TCCState { · 407 unmodified lines
408408 int warn_write_strings;
409409 int warn_unsupported;
410410 int warn_error;
411−
411+ int warn_none;
412+
412413 /* error handling */
413414 void *error_opaque;
414415 void (*error_func)(void *opaque, const char *msg);
@@ -1238,6 +1239,9 @@ void warning(const char *fmt, ...) · 823 unmodified lines
12381239 TCCState *s1 = tcc_state;
12391240 va_list ap;
12401241
1242+ if (s1->warn_none)
1243+ return;
1244+
12411245 va_start(ap, fmt);
12421246 error1(s1, 1, fmt, ap);
12431247 va_end(ap);
@@ -9551,16 +9555,6 @@ int tcc_set_warning(TCCState *s, const char *warning_name, int value) · 8307 unmodified lines
95519555
95529556 #if !defined(LIBTCC)
95539557
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−
95649558 /* extract the basename of a file */
95659559 static const char *tcc_basename(const char *name)
95669560 {
@@ -9872,7 +9866,7 @@ int main(int argc, char **argv) · 305 unmodified lines
98729866 }
98739867 break;
98749868 case TCC_OPTION_w:
9875− tcc_reset_warnings(s);
9869+ s->warn_none = 1;
98769870 break;
98779871 case TCC_OPTION_rdynamic:
98789872 s->rdynamic = 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t