summaryrefslogtreecommitdiff
path: root/gl/lib
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2009-04-06 12:23:26 +0100
committerPádraig Brady <P@draigBrady.com>2009-04-07 19:08:32 +0100
commit0f1b8c021d23d19f7c91738c6252558f8252f875 (patch)
tree39ad96bf82caa208c6a7be1d47e348155d6f1670 /gl/lib
parentaf5723c71e3efbfe60266162ebb5d07b45d72725 (diff)
downloadcoreutils-0f1b8c021d23d19f7c91738c6252558f8252f875.tar.xz
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__))
Diffstat (limited to 'gl/lib')
-rw-r--r--gl/lib/randint.c4
-rw-r--r--gl/lib/randread.c12
2 files changed, 11 insertions, 5 deletions
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)