Hi,
while building for arm I've noticed this warnings:

libbb/sha1.c:176:1: warning: "R0" redefined
In file included from 
/home/tito/Desktop/android/arm-2008q3/bin/../arm-none-linux-gnueabi/libc/usr/include/signal.h:353,
                 from include/libbb.h:22,
                 from libbb/sha1.c:31:
/home/tito/Desktop/android/arm-2008q3/bin/../arm-none-linux-gnueabi/libc/usr/include/sys/ucontext.h:44:1:
 warning: this is the location of the previous definition
libbb/sha1.c:177:1: warning: "R1" redefined
/home/tito/Desktop/android/arm-2008q3/bin/../arm-none-linux-gnueabi/libc/usr/include/sys/ucontext.h:46:1:
 warning: this is the location of the previous definition


The build completes, so it is not a big problem.
Attached is a trivial patch that seems to fix the problem.
Hope I've got it right with this obscure git voodo. 

Ciao,
Tito
From a03fafd923f61c5b1d3be7ea5a97543e8bb8d442 Mon Sep 17 00:00:00 2001
From: Tito Ragusa <[email protected]>
Date: Sun, 5 Jul 2009 16:37:38 +0200
Subject: [PATCH] Fix warnings in sha1.c when building for arm.

---
 libbb/sha1.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/libbb/sha1.c b/libbb/sha1.c
index 9fa095e..49bdc27 100644
--- a/libbb/sha1.c
+++ b/libbb/sha1.c
@@ -173,8 +173,8 @@ static void FAST_FUNC sha256_process_block64(sha256_ctx_t *ctx)
 #define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
 #define S0(x) (rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22))
 #define S1(x) (rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25))
-#define R0(x) (rotr32(x, 7) ^ rotr32(x, 18) ^ (x >> 3))
-#define R1(x) (rotr32(x, 17) ^ rotr32(x, 19) ^ (x >> 10))
+#define _R0(x) (rotr32(x, 7) ^ rotr32(x, 18) ^ (x >> 3))
+#define _R1(x) (rotr32(x, 17) ^ rotr32(x, 19) ^ (x >> 10))
 
 	/* Compute the message schedule according to FIPS 180-2:6.2.2 step 2.  */
 	for (t = 0; t < 16; ++t) {
@@ -183,7 +183,7 @@ static void FAST_FUNC sha256_process_block64(sha256_ctx_t *ctx)
 	}
 
 	for (/*t = 16*/; t < 64; ++t)
-		W[t] = R1(W[t - 2]) + W[t - 7] + R0(W[t - 15]) + W[t - 16];
+		W[t] = _R1(W[t - 2]) + W[t - 7] + _R0(W[t - 15]) + W[t - 16];
 
 	a = ctx->hash[0];
 	b = ctx->hash[1];
@@ -216,8 +216,8 @@ static void FAST_FUNC sha256_process_block64(sha256_ctx_t *ctx)
 #undef Maj
 #undef S0
 #undef S1
-#undef R0
-#undef R1
+#undef _R0
+#undef _R1
 	/* Add the starting values of the context according to FIPS 180-2:6.2.2
 	   step 4.  */
 	ctx->hash[0] += a;
@@ -252,8 +252,8 @@ static void FAST_FUNC sha512_process_block128(sha512_ctx_t *ctx)
 #define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
 #define S0(x) (rotr64(x, 28) ^ rotr64(x, 34) ^ rotr64(x, 39))
 #define S1(x) (rotr64(x, 14) ^ rotr64(x, 18) ^ rotr64(x, 41))
-#define R0(x) (rotr64(x, 1) ^ rotr64(x, 8) ^ (x >> 7))
-#define R1(x) (rotr64(x, 19) ^ rotr64(x, 61) ^ (x >> 6))
+#define _R0(x) (rotr64(x, 1) ^ rotr64(x, 8) ^ (x >> 7))
+#define _R1(x) (rotr64(x, 19) ^ rotr64(x, 61) ^ (x >> 6))
 
 	/* Compute the message schedule according to FIPS 180-2:6.3.2 step 2.  */
 	for (t = 0; t < 16; ++t) {
@@ -261,7 +261,7 @@ static void FAST_FUNC sha512_process_block128(sha512_ctx_t *ctx)
 		words++;
 	}
 	for (/*t = 16*/; t < 80; ++t)
-		W[t] = R1(W[t - 2]) + W[t - 7] + R0(W[t - 15]) + W[t - 16];
+		W[t] = _R1(W[t - 2]) + W[t - 7] + _R0(W[t - 15]) + W[t - 16];
 
 	/* The actual computation according to FIPS 180-2:6.3.2 step 3.  */
 	for (t = 0; t < 80; ++t) {
@@ -280,8 +280,8 @@ static void FAST_FUNC sha512_process_block128(sha512_ctx_t *ctx)
 #undef Maj
 #undef S0
 #undef S1
-#undef R0
-#undef R1
+#undef _R0
+#undef _R1
 	/* Add the starting values of the context according to FIPS 180-2:6.3.2
 	   step 4.  */
 	ctx->hash[0] += a;
-- 
1.5.6.5

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to