]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/c/c-errors.c
Update Copyright years for files modified in 2011 and/or 2012.
[thirdparty/gcc.git] / gcc / c / c-errors.c
1 /* Various diagnostic subroutines for the GNU C language.
2 Copyright (C) 2000, 2001, 2003, 2007, 2008, 2012
3 Free Software Foundation, Inc.
4 Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
5
6 This file is part of GCC.
7
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
10 Software Foundation; either version 3, or (at your option) any later
11 version.
12
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.
17
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
21
22 #include "config.h"
23 #include "system.h"
24 #include "coretypes.h"
25 #include "tm.h"
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
35 pedwarn_c99 (location_t location, int opt, const char *gmsgid, ...)
36 {
37 diagnostic_info diagnostic;
38 va_list ap;
39
40 va_start (ap, gmsgid);
41 diagnostic_set_info (&diagnostic, gmsgid, &ap, location,
42 flag_isoc99 ? DK_PEDWARN : DK_WARNING);
43 diagnostic.option_index = opt;
44 report_diagnostic (&diagnostic);
45 va_end (ap);
46 }
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
54 pedwarn_c90 (location_t location, int opt, const char *gmsgid, ...)
55 {
56 diagnostic_info diagnostic;
57 va_list ap;
58
59 va_start (ap, gmsgid);
60 diagnostic_set_info (&diagnostic, gmsgid, &ap, location,
61 flag_isoc99 ? DK_WARNING : DK_PEDWARN);
62 diagnostic.option_index = opt;
63 report_diagnostic (&diagnostic);
64 va_end (ap);
65 }