From: Erik van der Kouwe Date: Tue, 5 Oct 2010 07:25:47 +0000 (+0000) Subject: Fix warnings due to missing __dead attribute on exit X-Git-Tag: v3.2.0~790 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=ada0b4ca0414a6c5d613b1ef696b5dea02ec8769;p=minix.git Fix warnings due to missing __dead attribute on exit --- diff --git a/include/stdlib.h b/include/stdlib.h index 56a72f14b..8b53a0b2d 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -8,6 +8,7 @@ #endif #include +#include #include #define EXIT_FAILURE 1 /* standard error return using exit() */ @@ -29,7 +30,7 @@ _PROTOTYPE( int atoi, (const char *_nptr) ); _PROTOTYPE( long atol, (const char *_nptr) ); _PROTOTYPE( void *calloc, (size_t _nmemb, size_t _size) ); _PROTOTYPE( div_t div, (int _numer, int _denom) ); -_PROTOTYPE( void exit, (int _status) ); +_PROTOTYPE( __dead void exit, (int _status) ); _PROTOTYPE( void free, (void *_ptr) ); _PROTOTYPE( char *getenv, (const char *_name) ); _PROTOTYPE( long labs, (long _j) ); diff --git a/lib/libc/ansi/exit.c b/lib/libc/ansi/exit.c index 353413f05..a313e44e7 100644 --- a/lib/libc/ansi/exit.c +++ b/lib/libc/ansi/exit.c @@ -12,7 +12,7 @@ void (*__functab[NEXITS])(void); int __funccnt = 0; -extern void _exit(int); +extern __dead void _exit(int); /* only flush output buffers when necessary */ int (*_clean)(void) = NULL; @@ -27,7 +27,7 @@ _calls(void) (*__functab[i])(); } -void +__dead void exit(int status) { _calls();