このページを編集する際は,編集に関する方針に従ってください.[]
概要[]
- gcc-4.1.0/gcc/diagnostic.c, gcc-4.1.0/gcc/errors.cにて定義
- 警告の表示
- diagnostic.cの方が細かい
- configureかどこかで切り替えることができるのだろう
- 理由としてerros.cの方にインタフェースを揃えるための工夫がみえるというのがある
diagnostic.c[]
引数[]
- int opt
- const char *gmsgid
- ...
実装[]
441 /* A warning. Use this for code which is correct according to the
442 relevant language specification but is likely to be buggy anyway. */
443 void
444 warning (int opt, const char *gmsgid, ...)
445 {
446 diagnostic_info diagnostic;
447 va_list ap;
448
449 va_start (ap, gmsgid);
450 diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_WARNING);
451 diagnostic.option_index = opt;
452
453 report_diagnostic (&diagnostic);
454 va_end (ap);
455 }
errors.c[]
引数[]
- int opt ATTRIBUTE_UNUSED
- const char *format
- ...
実装[]
42 /* Print a warning message - output produced, but there may be problems. */
43
44 void
45 warning (int opt ATTRIBUTE_UNUSED, const char *format, ...)
46 {
47 va_list ap;
48
49 va_start (ap, format);
50 fprintf (stderr, "%s: warning: ", progname);
51 vfprintf (stderr, format, ap);
52 va_end (ap);
53 fputc('\n', stderr);
54 }