2 * This file is part of cparser.
3 * Copyright (C) 2012 Matthias Braun <matze@braunis.de>
12 /* define a NORETURN attribute */
14 # if defined(__GNUC__)
15 # if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 70)
16 # define NORETURN void __attribute__ ((noreturn))
17 # endif /* __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 70) */
18 # endif /* defined(__GNUC__) */
20 # if defined(_MSC_VER)
21 # define NORETURN void __declspec(noreturn)
22 # endif /* defined(_MSC_VER) */
24 /* If not set above, use "void" for DOES_NOT_RETURN. */
26 # define NORETURN void
27 # endif /* ifndef NORETURN */
28 #endif /* ifndef NORETURN */
31 * Issue a diagnostic message.
33 * %E expression_t const*
36 * %#k va_list*, char const*
39 * %P position_t const*
40 * %Q unsigned (qualifier)
43 * %#T type_t const*, symbol_t const*
46 void diagnosticf(const char *fmt, ...);
47 void errorf(const position_t *pos, const char *fmt, ...);
48 void warningf(warning_t, const position_t *pos, const char *fmt, ...);
49 NORETURN internal_errorf(const position_t *pos, const char *fmt, ...);
51 extern unsigned error_count;
52 extern unsigned warning_count;
53 extern bool show_column; /**< Show column in diagnostic messages */
54 extern bool diagnostics_show_option; /**< Show the switch, which controls a warning. */