Skip to contentSkip to conversation

OpenVPN AutoConf macro bug

Openvpn-devel David Stipp 2 participants 2 messages Nov 22, 2005 – Nov 24, 2005

lore
Share & tools
lore
#0 lore raw

Hi all,

There's a bug in the autoconf macros that cause the compile to fail on Sun Studio 9. One of the tests (empty array support) is not escaped properly, so the macro int bar[0] expands to int bar0, which won't exactly test what it needs to be testing...

Patch below. (basically put the bar[0] brackets within brackets.)

********************************************************************************

acinclude.m4 2005-11-21 17:12:51.172087000 -0600 renamed from acinclude.m4.orig 2005-11-21 17:13:48.214828000 -0600 +1 -1
@@ -19,7 +19,7 @@
   AC_MSG_RESULT([checking for C compiler empty array support])
   AC_COMPILE_IFELSE(
     [
-        struct { int foo; int bar[0]; } mystruct;
+        struct { int foo; int bar[[0]]; } mystruct;
     ], [
         AC_DEFINE_UNQUOTED(EMPTY_ARRAY_SIZE, 0, [Dimension to use for

empty array declaration])

     ], [

********************************************************************************

I checked trunk in svn last night and noticed the same problem. It's be nice if this change could be included.

Please CC me on any additional correspondence as I am not on the mailing list.

Thanks!

David

Signature · 1 line
David Stipp <[email protected]...>
#1 lore raw
Quoted 22 lines · David Stipp

Hi all,

There's a bug in the autoconf macros that cause the compile to fail on Sun Studio 9. One of the tests (empty array support) is not escaped properly, so the macro int bar[0] expands to int bar0, which won't exactly test what it needs to be testing...

Patch below. (basically put the bar[0] brackets within brackets.)

********************************************************************************

acinclude.m4 2005-11-21 17:12:51.172087000 -0600 renamed from acinclude.m4.orig 2005-11-21 17:13:48.214828000 -0600 +1 -1
@@ -19,7 +19,7 @@
   AC_MSG_RESULT([checking for C compiler empty array support])
   AC_COMPILE_IFELSE(
     [
-        struct { int foo; int bar[0]; } mystruct;
+        struct { int foo; int bar[[0]]; } mystruct;
     ], [
         AC_DEFINE_UNQUOTED(EMPTY_ARRAY_SIZE, 0, [Dimension to use for
 empty array declaration])
     ], [
Quoted 4 lines

********************************************************************************

I checked trunk in svn last night and noticed the same problem. It's be nice if this change could be included.

Thanks -- nice catch. I will merge this as well in the next 2.0.x and 2.1 releases.

James