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>
6 This file is part of GCC.
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
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
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/>. */
24 #include "coretypes.h"
30 #include "diagnostic.h"
32 /* Issue an ISO C99 pedantic warning MSGID. */
35 pedwarn_c99 (location_t location
, int opt
, const char *gmsgid
, ...)
37 diagnostic_info diagnostic
;
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
);
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.) */
54 pedwarn_c90 (location_t location
, int opt
, const char *gmsgid
, ...)
56 diagnostic_info diagnostic
;
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
);