]> sourceware.org Git - glibc.git/blame - misc/error.h
Test errno setting on strtod overflow in tst-strtod-round
[glibc.git] / misc / error.h
CommitLineData
19361cb7 1/* Declaration for error-reporting function
dff8da6b 2 Copyright (C) 1995-2024 Free Software Foundation, Inc.
8c620ae0 3 This file is part of the GNU C Library.
196980f5 4
54d79e99 5 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
196980f5 9
54d79e99
UD
10 The GNU C Library 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 GNU
41bdb6e2 13 Lesser General Public License for more details.
196980f5 14
41bdb6e2 15 You should have received a copy of the GNU Lesser General Public
59ba27a6 16 License along with the GNU C Library; if not, see
5a82c748 17 <https://www.gnu.org/licenses/>. */
196980f5 18
5107cf1d
UD
19#ifndef _ERROR_H
20#define _ERROR_H 1
196980f5 21
b80bfc8b 22#include <features.h>
196980f5 23
b80bfc8b
UD
24
25__BEGIN_DECLS
54d79e99 26
19c3f208
RM
27/* Print a message with `fprintf (stderr, FORMAT, ...)';
28 if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
29 If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
30
a784e502 31extern void error (int __status, int __errnum, const char *__format, ...)
e6a25275 32 __attribute__ ((__format__ (__printf__, 3, 4))) __COLD;
19c3f208 33
a784e502
UD
34extern void error_at_line (int __status, int __errnum, const char *__fname,
35 unsigned int __lineno, const char *__format, ...)
e6a25275 36 __attribute__ ((__format__ (__printf__, 5, 6))) __COLD;
19bc17a9 37
19c3f208
RM
38/* If NULL, error will flush stdout, then print on stderr the program
39 name, a colon and a space. Otherwise, error will call this
40 function without parameters instead. */
41extern void (*error_print_progname) (void);
42
196980f5
RM
43/* This variable is incremented each time `error' is called. */
44extern unsigned int error_message_count;
45
19bc17a9
RM
46/* Sometimes we want to have at most one error per line. This
47 variable controls whether this mode is selected or not. */
48extern int error_one_per_line;
49
e4a39992 50#include <bits/floatn.h>
e2239af3 51#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
d11086a9
GG
52# include <bits/error-ldbl.h>
53#else
54/* Do not inline error and error_at_line when long double has the same
e4a39992
GG
55 size of double, nor when long double reuses the float128
56 implementation, because that would invalidate the redirections to the
d11086a9
GG
57 compatibility functions. */
58# if defined __extern_always_inline && defined __va_arg_pack
59# include <bits/error.h>
60# endif
54d79e99
UD
61#endif
62
b80bfc8b
UD
63__END_DECLS
64
5107cf1d 65#endif /* error.h */
This page took 0.662197 seconds and 6 git commands to generate.