Bug 7476 - configure fails when checking for 'designated initializers' on NSK
Summary: configure fails when checking for 'designated initializers' on NSK
Status: RESOLVED WONTFIX
Alias: None
Product: Samba 3.5
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.5.3
Hardware: Other Other
: P3 normal
Target Milestone: ---
Assignee: Björn Jacke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-28 02:56 UTC by Joachim Schmitz (mail address dead)
Modified: 2010-09-22 05:20 UTC (History)
0 users

See Also:


Attachments
Patch (47.44 KB, patch)
2010-05-31 12:14 UTC, Joachim Schmitz (mail address dead)
no flags Details
Patch for libreplace_macros.m4 (760 bytes, patch)
2010-06-08 07:06 UTC, Joachim Schmitz (mail address dead)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joachim Schmitz (mail address dead) 2010-05-28 02:56:38 UTC
configure fails when checking for 'designated initializers' on NSK.
My patch (but I don't beile this is the right spot to fix this):

diff -u ./source3/configure.orig ./source3/configure
--- ./source3/configure.orig	2010-05-17 06:53:13.000000000 -0500
+++ ./source3/configure	2010-05-26 07:58:34.000000000 -0500
@@ -5878,6 +5878,58 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+# NonStop, try c89's option -Wc99lite, should do for designated initializers
+if test x"$c99_init" = x"no"; then
+    { $as_echo "$as_me:$LINENO: checking for C99 designated initializers with -Wc99lite" >&5
+$as_echo_n "checking for C99 designated initializers with -Wc99lite... " >&6; }
+    CFLAGS="$saved_CFLAGS -Wc99lite"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+ struct foo {int x;char y;};
+       struct foo bar = { .y = 'X', .x = 1 };
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }; c99_init=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
 if test "`uname`" = "HP-UX"; then
   if test "$ac_cv_c_compiler_gnu" = no; then


I did a simiral patch for source4/configure, but as that does get generated, it doesn't persist. Here it goes anyway:

diff -u ./source4/configure.orig ./source4/configure
--- ./source4/configure.orig	2010-05-27 05:59:40.000000000 -0500
+++ ./source4/configure	2010-05-27 06:24:13.000000000 -0500
@@ -4440,6 +4440,61 @@
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+# NonStop, try c89's option -Wc99lite, should do for designated initializers
+if test x"$c99_init" = x"no"; then
+    echo "$as_me:$LINENO: checking for C99 designated initializers with -Wc99lite" >&5
+echo $ECHO_N "checking for C99 designated initializers with -Wc99lite... $ECHO_C" >&6
+    CFLAGS="$saved_CFLAGS -Wc99lite"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+ struct foo {int x;char y;};
+       struct foo bar = { .y = 'X', .x = 1 };
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; c99_init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
 if test "`uname`" = "HP-UX"; then
   if test "$ac_cv_c_compiler_gnu" = no; then


Baseline is that configure would need to check with "-Wc99lite" to work properly on NonStop TNS/E machines (the compiler on the older nonStop TNS/R machines doesn't have that switch nor the features that go along with it)

bye, Jojo
Comment 1 Joachim Schmitz (mail address dead) 2010-05-31 12:14:01 UTC
Created attachment 5751 [details]
Patch

I believe I found the proper spot for addding the check for -Wc99lite now, in .../lib/libreplace/libreplace_macros.m4.
Patch attached.

Bye, Jojo
Comment 2 Joachim Schmitz (mail address dead) 2010-06-08 07:06:16 UTC
Created attachment 5769 [details]
Patch for libreplace_macros.m4

forget the 1st patch dunno what I was up ti there. This one here should be correct
Comment 3 Joachim Schmitz (mail address dead) 2010-07-24 06:17:25 UTC
This problem will shortly be a historical one, as we will get a c99 compiler next month or so, so won't need that "c89 -Wc99lite" any more.
Only for newer OS releases though, so this problem might need to get fixed for our older release.
Comment 4 Joachim Schmitz (mail address dead) 2010-09-22 05:20:35 UTC
I've now fixed it for this platform via a wrapper script for our compiler, so we can close this issue.