1 /* Definitions for error and warning reporting utilities. 2 Copyright 2002 Paul Twohey. 3 4 This file is part of VMIPS. 5 6 VMIPS is free software; you can redistribute it and/or modify it 7 under the terms of the GNU General Public License as published by the 8 Free Software Foundation; either version 2 of the License, or (at your 9 option) any later version. 10 11 VMIPS is distributed in the hope that it will be useful, but 12 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 for more details. 15 16 You should have received a copy of the GNU General Public License along 17 with VMIPS; if not, write to the Free Software Foundation, Inc., 18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 19 20 #include "gccattr.h" 21 22 #ifndef _ERROR_H_ 23 #define _ERROR_H_ 24 25 /* Use to report all program errors. MSG is a printf(3) style format 26 * specification for the remaining arguments. error() will always output 27 * a newline after MSG. 28 */ 29 __ATTRIBUTE_FORMAT__(printf, 1, 2) 30 void error(const char *msg, ...); 31 32 /* As with error(), but calls exit() with an error code of 1 afterwards. 33 */ 34 __ATTRIBUTE_NORETURN__ 35 __ATTRIBUTE_FORMAT__(printf, 1, 2) 36 void error_exit(const char *msg, ...); 37 38 /* Use to report all fatal program errors. Calls abort(3) after printing 39 * a message. MSG is a printf(3) style format specification for the remaining 40 * arguments. fatal_error() will always output a newline after MSG. 41 */ 42 __ATTRIBUTE_NORETURN__ 43 __ATTRIBUTE_FORMAT__(printf, 1, 2) 44 void fatal_error(const char *msg, ...); 45 46 /* Use to report warning conditions for the program. MSG is a printf(3) style 47 * format specification for the remaining arguments. warning() will always 48 * output a newline after MSG. 49 */ 50 __ATTRIBUTE_FORMAT__(printf, 1, 2) 51 void warning(const char *msg, ...); 52 53 #endif /* _ERROR_H_ */ 54