[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] maint: avoid warning from gcc's -Wunused-macros
From: |
Jim Meyering |
Subject: |
[PATCH] maint: avoid warning from gcc's -Wunused-macros |
Date: |
Sun, 07 Oct 2012 10:42:14 +0200 |
Building with --enable-gcc-warnings on e.g., Fedora 18,
I would get this:
src/factor.c:148:0: error: macro "__clz_tab" is not used
[-Werror=unused-macros]
src/factor.c:126:0: error: macro "UHWtype" is not used [-Werror=unused-macros]
cc1: all warnings being treated as errors
make[2]: *** [src/factor.o] Error 1
I'm sure there's a cleaner way to fix it, but this is
good enough for now.
>From 231e40a6ba29b892daca1e4a2e464c315874e155 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 7 Oct 2012 10:37:25 +0200
Subject: [PATCH] maint: avoid warning from gcc's -Wunused-macros
On some systems, -Wunused-macros would warn about two macros:
src/factor.c:148:0: warning: macro "__clz_tab" is not used
src/factor.c:126:0: warning: macro "UHWtype" is not used
* src/factor.c: Add a use to placate gcc.
---
src/factor.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/factor.c b/src/factor.c
index 1ca5812..5bfbfdc 100644
--- a/src/factor.c
+++ b/src/factor.c
@@ -173,6 +173,12 @@ const unsigned char factor_clz_tab[129] =
#endif
+#if !defined __clz_tab && !defined UHWtype
+/* Without this seemingly useless conditional, gcc -Wunused-macros
+ warns that each of the two tested macros is unused on Fedora 18.
+ FIXME: this is just an ugly band-aid. Fix it properly. */
+#endif
+
enum alg_type { ALG_POLLARD_RHO = 1, ALG_SQUFOF = 2 };
static enum alg_type alg;
--
1.8.0.rc0.18.gf84667d
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] maint: avoid warning from gcc's -Wunused-macros,
Jim Meyering <=