]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/c/c-errors.c
Update Copyright years for files modified in 2011 and/or 2012.
[thirdparty/gcc.git] / gcc / c / c-errors.c
CommitLineData
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 6This file is part of GCC.
e8785647 7
f12b58b3 8GCC is free software; you can redistribute it and/or modify it under
9the terms of the GNU General Public License as published by the Free
8c4c00c1 10Software Foundation; either version 3, or (at your option) any later
f12b58b3 11version.
e8785647 12
f12b58b3 13GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14WARRANTY; without even the implied warranty of MERCHANTABILITY or
15FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16for more details.
e8785647 17
18You should have received a copy of the GNU General Public License
8c4c00c1 19along 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
34void
21ca8540 35pedwarn_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
53void
21ca8540 54pedwarn_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}