bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] make check failure on Tru64 Unix


From: Gary V. Vaughan
Subject: [PATCH] make check failure on Tru64 Unix
Date: Mon, 11 Mar 2013 12:18:36 +0700

M4 master with latest gnulib is not picking up gnulib strtod for some
reason, even though it is compiled and added to libm4.a on this platform:

tru64% make check
...
Checking ./180.format                                                     
@ ../doc/m4.texi:6069: Origin of test
./180.format: stdout mismatch
*** m4-tmp.93382/m4-xout        Mon Mar 11 02:50:45 2013
--- m4-tmp.93382/m4-out Mon Mar 11 02:50:45 2013
***************
*** 5,8 ****
  5000
  success
  success
! 20
--- 5,8 ----
  5000
  success
  success
! 0
@ ../doc/m4.texi:6069: Origin of test
./180.format: stderr mismatch
*** m4-tmp.93382/m4-xerr        Mon Mar 11 02:50:45 2013
--- m4-tmp.93382/m4-err Mon Mar 11 02:50:45 2013
***************
*** 0 ****
--- 1 ----                                 
+ m4:stdin:12: non-numeric argument 0xa.P+1
Checking ./181.format                      
...
Failed checks were:
  ./180.format:out ./180.format:err
...

So the format builtin is not working:

tru64% src/m4
format(`%g', `0xa.P+1')
./m4:stdin:1: non-numeric argument 0xa.P+1
0

Which is due to the system strtod being used:

tru64% cat x.c
#include <stdio.h>
#include <stdlib.h>
void main () { printf("%g,%g\n", 0xa.P+1, strtod("0xa.P+1", NULL)); }
tru64% cc x.c && ./a.out
20,0
tru64% { echo '#include <config.h>'; cat x.c; } > y.c
tru64% cc -Ilib y.c lib/libm4.a && ./a.out
20,20
tru64% { echo '#include "m4.h"'; cat x.c; } > z.c
tru64% cc -Ilib -Isrc z.c lib/libm4.a && ./a.out
20,0

I bisected my way to this fix in gnulib/lib/unistd.h.in:

--- lib/unistd.in.h.orig        2013-03-11 05:09:57.035508275 +0000            
+++ lib/unistd.in.h     2013-03-11 04:53:49.489269636 +0000                    
@@ -62,7 +62,8 @@                                                              
    <unistd.h>.  */                                                            
 /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>.  */ 
+/* OSF Tru64 Unix cannot see gnulib rpl_strtod when system <stdlib.h> is 
included here. */
 /* But avoid namespace pollution on glibc systems.  */                        
-#ifndef __GLIBC__                                                             
+#if !defined __GLIBC__ && !defined __osf__                                    
 # define __need_system_stdlib_h                                               
 # include <stdlib.h>                                                          
 # undef __need_system_stdlib_h                                                

After reconfiguring and building with this patch, m4 now picks up the working
gnulib strtod:

tru64% src/m4
format(`%g', `0xa.P+1')
20

And the full testsuite (gnulib tests and all) passes on this platform now.

Any objections if I push the fix?

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]