2 * This file is part of cparser.
3 * Copyright (C) 2007-2009 Matthias Braun <matze@braunis.de>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 /* define a NORETURN attribute */
29 # if defined(__GNUC__)
30 # if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 70)
31 # define NORETURN void __attribute__ ((noreturn))
32 # endif /* __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 70) */
33 # endif /* defined(__GNUC__) */
35 # if defined(_MSC_VER)
36 # define NORETURN void __declspec(noreturn)
37 # endif /* defined(_MSC_VER) */
39 /* If not set above, use "void" for DOES_NOT_RETURN. */
41 # define NORETURN void
42 # endif /* ifndef NORETURN */
43 #endif /* ifndef NORETURN */
46 * Issue a diagnostic message.
48 * %E expression_t const*
51 * %#k va_list*, char const*
54 * %P source_position_t const*
55 * %Q unsigned (qualifier)
58 * %#T type_t const*, symbol_t const*
61 void diagnosticf(const char *fmt, ...);
62 void errorf(const source_position_t *pos, const char *fmt, ...);
63 void warningf(warning_t, const source_position_t *pos, const char *fmt, ...);
64 NORETURN internal_errorf(const source_position_t *pos, const char *fmt, ...);
66 extern unsigned error_count;
67 extern unsigned warning_count;
68 extern bool show_column; /**< Show column in diagnostic messages */
69 extern bool diagnostics_show_option; /**< Show the switch, which controls a warning. */