[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] maint: remove compiler warnings from randint and randread module
From: |
Pádraig Brady |
Subject: |
[PATCH] maint: remove compiler warnings from randint and randread modules |
Date: |
Mon, 6 Apr 2009 12:32:52 +0100 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20071008) |
A small patch to remove compiler warnings I noticed
while compiling these modules for the shred speedups.
cheers,
Pádraig.
>From 94135b46056b93590cce603950db5a3f4e33aa15 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?P=C3=A1draig=20Brady?= <address@hidden>
Date: Mon, 6 Apr 2009 12:23:26 +0100
Subject: [PATCH] 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(-)
diff --git a/gl/lib/randint.c b/gl/lib/randint.c
index 53e8c32..df1a69d 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 b81a451..72586ec 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
@@ -106,7 +116,7 @@ struct randread_source
/* The default error handler. */
-static void
+static void ATTRIBUTE_NORETURN
randread_error (void const *file_name)
{
if (file_name)
--
1.5.3.6
- [patch #6797] shred option to use internal RNG, (continued)
- [patch #6797] shred option to use internal RNG, Steven Schveighoffer, 2009/04/01
- [patch #6797] shred option to use internal RNG, Eric Blake, 2009/04/01
- [patch #6797] shred option to use internal RNG, Steven Schveighoffer, 2009/04/01
- Re: [patch #6797] shred option to use internal RNG, Pádraig Brady, 2009/04/02
- Re: [patch #6797] shred option to use internal RNG, Jim Meyering, 2009/04/02
- Re: [patch #6797] shred option to use internal RNG, Steve Schveighoffer, 2009/04/02
- [patch #6797] shred option to use internal RNG, James Youngman, 2009/04/05
- Re: [patch #6797] shred option to use internal RNG, Jim Meyering, 2009/04/05
- Re: [patch #6797] shred option to use internal RNG, Pádraig Brady, 2009/04/05
- Re: [patch #6797] shred option to use internal RNG, Pádraig Brady, 2009/04/06
- [PATCH] maint: remove compiler warnings from randint and randread modules,
Pádraig Brady <=
- Re: [patch #6797] shred option to use internal RNG, Jim Meyering, 2009/04/07
- Re: [patch #6797] shred option to use internal RNG, Pádraig Brady, 2009/04/07
- Re: [patch #6797] shred option to use internal RNG, Pádraig Brady, 2009/04/07
- Re: [patch #6797] shred option to use internal RNG, Jim Meyering, 2009/04/07
- Re: [patch #6797] shred option to use internal RNG, Steve Schveighoffer, 2009/04/07