From: Pádraig Brady
Date: Mon, 6 Apr 2009 11:23:26 +0000 (+0100) Subject: maint: remove compiler warnings from randint and randread modules X-Git-Tag: v7.3~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0f1b8c021d23d19f7c91738c6252558f8252f875;p=thirdparty%2Fcoreutils.git maint: remove compiler warnings from randint and randread modules * gl/lib/randint.c: Remove unused MAX macro * gl/lib/randread.c (randread_error): Add __attribute__((__noreturn__)) --- diff --git a/gl/lib/randint.c b/gl/lib/randint.c index 53e8c32698..df1a69d5c6 100644 --- a/gl/lib/randint.c +++ b/gl/lib/randint.c @@ -50,10 +50,6 @@ main (int argc, char **argv) #include "xalloc.h" -#ifndef MAX -# define MAX(a,b) ((a) < (b) ? (b) : (a)) -#endif - /* A source of random data for generating random integers. */ struct randint_source { diff --git a/gl/lib/randread.c b/gl/lib/randread.c index 798d4e0a36..48ce92e9ab 100644 --- a/gl/lib/randread.c +++ b/gl/lib/randread.c @@ -39,6 +39,16 @@ #include "unlocked-io.h" #include "xalloc.h" +#ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) +# define __attribute__(x) /* empty */ +# endif +#endif + +#ifndef ATTRIBUTE_NORETURN +# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) +#endif + #ifndef MIN # define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif @@ -100,7 +110,7 @@ struct randread_source /* The default error handler. */ -static void +static void ATTRIBUTE_NORETURN randread_error (void const *file_name) { if (file_name)