# endif
#endif
-#ifndef ATTRIBUTE_NORETURN
-# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-#endif
-
#ifndef MIN
# define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
/* The default error handler. */
-static void ATTRIBUTE_NORETURN
+static void
randread_error (void const *file_name)
{
if (file_name)
sigprocmask (SIG_SETMASK, &oldset, NULL);
}
-static void cleanup_fatal (void) ATTRIBUTE_NORETURN;
-static void
+static _Noreturn void
cleanup_fatal (void)
{
cleanup ();
/* Handle an attempt to read beyond EOF under the control of record P,
on iteration REPETITION if nonzero. */
-static void handle_line_error (const struct control *, uintmax_t)
- ATTRIBUTE_NORETURN;
static void
handle_line_error (const struct control *p, uintmax_t repetition)
{
handle_line_error (p, repetition);
}
-static void regexp_error (struct control *, uintmax_t, bool) ATTRIBUTE_NORETURN;
static void
regexp_error (struct control *p, uintmax_t repetition, bool ignore)
{
print_stats ();
}
-static void ATTRIBUTE_NORETURN
+static void
quit (int code)
{
finish_up ();
/* Report a write error and exit. */
-static void write_error (void) ATTRIBUTE_NORETURN;
static void
write_error (void)
{
/* Diagnose an error in the regular expression matcher. Then exit. */
-static void ATTRIBUTE_NORETURN
+static void
matcher_error (void)
{
die (EXIT_FAILURE, errno, _("error in regular expression matcher"));
}
}
-static void ATTRIBUTE_NORETURN
+static void
io_error (void)
{
/* FIXME: consider option to silently ignore errno=EPIPE */
This can be used safely from signal handlers,
and between fork and exec of multithreaded processes. */
-static void async_safe_die (int, char const *) ATTRIBUTE_NORETURN;
-static void
+static _Noreturn void
async_safe_die (int errnum, char const *errstr)
{
ignore_value (write (STDERR_FILENO, errstr, strlen (errstr)));
/* Report MESSAGE for FILE, then clean up and exit.
If FILE is null, it represents standard output. */
-static void sort_die (char const *, char const *) ATTRIBUTE_NORETURN;
static void
sort_die (char const *message, char const *file)
{
/* Report a bad field specification SPEC, with extra info MSGID. */
-static void badfieldspec (char const *, char const *)
- ATTRIBUTE_NORETURN;
static void
badfieldspec (char const *spec, char const *msgid)
{
/* Report incompatible options. */
-static void incompatible_options (char const *) ATTRIBUTE_NORETURN;
static void
incompatible_options (char const *opts)
{
# endif
#endif
-#ifndef ATTRIBUTE_NORETURN
-# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-#endif
-
/* The warn_unused_result attribute appeared first in gcc-3.4.0 */
#undef ATTRIBUTE_WARN_UNUSED_RESULT
#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
|| S_TYPEISSHM (sb) || S_TYPEISTMO (sb));
}
-void usage (int status) ATTRIBUTE_NORETURN;
+_Noreturn void usage (int status);
/* Like error(0, 0, ...), but without an implicit newline.
Also a noop unless the global DEV_DEBUG is set. */
}
/* Ensure exit, either with SIGPIPE or EXIT_FAILURE status. */
-static void ATTRIBUTE_NORETURN
+static void
die_pipe (void)
{
raise (SIGPIPE);
static bool and (void);
static bool or (void);
-static void test_syntax_error (char const *format, ...)
- ATTRIBUTE_NORETURN;
-static void beyond (void) ATTRIBUTE_NORETURN;
+static void beyond (void);
-static void
+static _Noreturn void
test_syntax_error (char const *format, ...)
{
va_list ap;