]> git.saurik.com Git - bison.git/blame - src/complain.h
* HACKING (Release Procedure): Recommend a secure automake.
[bison.git] / src / complain.h
CommitLineData
a0f6b076 1/* Declaration for error-reporting function for Bison.
98744608
JD
2 Copyright (C) 2000, 2001, 2002, 2006, 2009 Free Software Foundation,
3 Inc.
a0f6b076 4
f16b0819
PE
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
a0f6b076
AD
9
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.
14
15 You should have received a copy of the GNU General Public License
f16b0819 16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
a0f6b076
AD
17
18#ifndef COMPLAIN_H_
ee000ba4 19# define COMPLAIN_H_ 1
a0f6b076 20
ee000ba4
AD
21# include "location.h"
22
23# ifdef __cplusplus
a0f6b076 24extern "C" {
ee000ba4 25# endif
a0f6b076 26
23eb2a69 27/** Informative messages, but we proceed. */
a0f6b076 28
81ebdef9 29void warn (char const *format, ...)
52489d44
AD
30 __attribute__ ((__format__ (__printf__, 1, 2)));
31
81ebdef9 32void warn_at (location loc, char const *format, ...)
e9955c83 33 __attribute__ ((__format__ (__printf__, 2, 3)));
a0f6b076 34
23eb2a69 35/** An error, but we continue and die later. */
a0f6b076 36
81ebdef9 37void complain (char const *format, ...)
52489d44
AD
38 __attribute__ ((__format__ (__printf__, 1, 2)));
39
81ebdef9 40void complain_at (location loc, char const *format, ...)
e9955c83 41 __attribute__ ((__format__ (__printf__, 2, 3)));
a0f6b076 42
23eb2a69 43/** A fatal error, causing immediate exit. */
a0f6b076 44
81ebdef9 45void fatal (char const *format, ...)
ec88357a 46 __attribute__ ((__noreturn__, __format__ (__printf__, 1, 2)));
e9955c83 47
81ebdef9 48void fatal_at (location loc, char const *format, ...)
ec88357a 49 __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
a0f6b076 50
23eb2a69 51/** Whether an error was reported. */
ec88357a 52extern bool complaint_issued;
a0f6b076 53
ee000ba4 54# ifdef __cplusplus
a0f6b076 55}
ee000ba4 56# endif
a0f6b076
AD
57
58#endif /* !COMPLAIN_H_ */