From 0f1b8c021d23d19f7c91738c6252558f8252f875 Mon Sep 17 00:00:00 2001 From: Pádraig Brady
Date: Mon, 6 Apr 2009 12:23:26 +0100 Subject: 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__)) --- gl/lib/randint.c | 4 ---- gl/lib/randread.c | 12 +++++++++++- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'gl/lib') diff --git a/gl/lib/randint.c b/gl/lib/randint.c index 53e8c3269..df1a69d5c 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 798d4e0a3..48ce92e9a 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) -- cgit v1.2.3-70-g09d2