Project

General

Profile

Actions

Bug #3141

closed

error: redefinition of 'i'

Added by ryandesign almost 3 years ago. Updated almost 3 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:
No

Description

Building lighttpd 1.4.64 on macOS 10.15.7 fails when I tried to enable nettle support in addition to what I had previously enabled.

./configure args are --with-brotli --with-lua=lua --with-nettle --with-pcre2 --with-xxhash --with-zlib --with-openssl

make output is:

rand.c:389:9: error: redefinition of 'i'
    int i;
        ^
rand.c:372:9: note: previous definition is here
    int i = (int)nettle_knuth_lfib_get(&knuth_lfib_ctx);
        ^
1 error generated.

If I fix that, then it does build.

Actions #1

Updated by gstrauss almost 3 years ago

  • Category set to core
  • Status changed from New to Patch Pending
  • Target version changed from 1.4.xx to 1.4.65
--- a/src/rand.c
+++ b/src/rand.c
@@ -387,9 +387,9 @@ int li_rand_pseudo (void)
         return i;
   #endif
   #ifdef HAVE_CCRANDOMGENERATEBYTES
-    int i;
-    if (CCRandomGenerateBytes(&i, sizeof(i)) == kCCSuccess)
-        return i;
+    int j;
+    if (CCRandomGenerateBytes(&j, sizeof(j)) == kCCSuccess)
+        return j;
   #endif
   #ifdef HAVE_ARC4RANDOM_BUF
     return (int)arc4random();
Actions #2

Updated by ryandesign almost 3 years ago

Thanks, yes that patch works.

Actions #3

Updated by gstrauss almost 3 years ago

  • Status changed from Patch Pending to Fixed
Actions

Also available in: Atom