]>
Commit | Line | Data |
---|---|---|
e8785647 | 1 | /* Various diagnostic subroutines for the GNU C language. |
71e45bc2 | 2 | Copyright (C) 2000, 2001, 2003, 2007, 2008, 2012 |
3 | Free Software Foundation, Inc. | |
e8785647 | 4 | Contributed by Gabriel Dos Reis <gdr@codesourcery.com> |
5 | ||
f12b58b3 | 6 | This file is part of GCC. |
e8785647 | 7 | |
f12b58b3 | 8 | GCC is free software; you can redistribute it and/or modify it under |
9 | the terms of the GNU General Public License as published by the Free | |
8c4c00c1 | 10 | Software Foundation; either version 3, or (at your option) any later |
f12b58b3 | 11 | version. |
e8785647 | 12 | |
f12b58b3 | 13 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
14 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 | for more details. | |
e8785647 | 17 | |
18 | You should have received a copy of the GNU General Public License | |
8c4c00c1 | 19 | along with GCC; see the file COPYING3. If not see |
20 | <http://www.gnu.org/licenses/>. */ | |
e8785647 | 21 | |
22 | #include "config.h" | |
23 | #include "system.h" | |
805e22b2 | 24 | #include "coretypes.h" |
25 | #include "tm.h" | |
e8785647 | 26 | #include "tree.h" |
27 | #include "c-tree.h" | |
28 | #include "tm_p.h" | |
29 | #include "flags.h" | |
30 | #include "diagnostic.h" | |
31 | ||
32 | /* Issue an ISO C99 pedantic warning MSGID. */ | |
33 | ||
34 | void | |
21ca8540 | 35 | pedwarn_c99 (location_t location, int opt, const char *gmsgid, ...) |
e8785647 | 36 | { |
25e2ffe1 | 37 | diagnostic_info diagnostic; |
ee582a61 | 38 | va_list ap; |
a0c938f0 | 39 | |
380c6697 | 40 | va_start (ap, gmsgid); |
21ca8540 | 41 | diagnostic_set_info (&diagnostic, gmsgid, &ap, location, |
a52d5726 | 42 | flag_isoc99 ? DK_PEDWARN : DK_WARNING); |
8864917d | 43 | diagnostic.option_index = opt; |
25e2ffe1 | 44 | report_diagnostic (&diagnostic); |
ee582a61 | 45 | va_end (ap); |
e8785647 | 46 | } |
aa267cf6 | 47 | |
48 | /* Issue an ISO C90 pedantic warning MSGID. This function is supposed to | |
49 | be used for matters that are allowed in ISO C99 but not supported in | |
50 | ISO C90, thus we explicitly don't pedwarn when C99 is specified. | |
51 | (There is no flag_c90.) */ | |
52 | ||
53 | void | |
21ca8540 | 54 | pedwarn_c90 (location_t location, int opt, const char *gmsgid, ...) |
aa267cf6 | 55 | { |
56 | diagnostic_info diagnostic; | |
57 | va_list ap; | |
58 | ||
380c6697 | 59 | va_start (ap, gmsgid); |
21ca8540 | 60 | diagnostic_set_info (&diagnostic, gmsgid, &ap, location, |
a52d5726 | 61 | flag_isoc99 ? DK_WARNING : DK_PEDWARN); |
8864917d | 62 | diagnostic.option_index = opt; |
aa267cf6 | 63 | report_diagnostic (&diagnostic); |
64 | va_end (ap); | |
65 | } |