pspp-dev
[Top][All Lists]
Advanced

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

Re: PSPP & PSPPIRE running as native windows applications.


From: John McCabe-Dansted
Subject: Re: PSPP & PSPPIRE running as native windows applications.
Date: Wed, 7 Feb 2007 23:49:13 +0900

On 2/7/07, John Darrington <address@hidden> wrote:
Three of the tests were failing merely due to whitespace differences.
I've fixed these three tests.

I've done a cvs up and recompiled. Now I get 33 failures instead of just 32 :(

The new log is at:
http://www.csse.uwa.edu.au/~john/newmake2.log

The differences shown in the  RANK test is interesting.  I suspect the
problem is at src/language/stats/rank.q:701

  snprintf(func_abb, 4, "%s", function_name[f]);

according to my man page " The functions snprintf() and vsnprintf() do
not write more than size bytes (including the trailing '\0').", but
your version does not seem to include the trailing null in the size,
so we're seeing one more character.  Perhaps you should report that
to the maintainer of your C library.  Alternatively perhaps we should
be using gnulib/autoconf to deal with broken implementations.

I made a testfile. Your suspicions are correct.
 i=snprintf(x,4,"12345");
 Linux: i=5, x="123"
 Wine: i=-1, x="1234"

This is a known bug:
 http://sourceforge.net/mailarchive/message.php?msg_id=38119968

Presumably wine follows the old incorrect windows behavior. I suspect
that we simply shouldn't rely on snprintf being correct on windows,
since testing for correctness of snprintf when cross-compiling doesn't
really tells us anything useful. Perhaps we should just bundle a
portable version of snprintf in the windows.exe, such as the
following:
 http://www.ijs.si/software/snprintf/

The bad snprintf might also cause segfaults if it fails to terminate
the string with '\0'.

--

On the topic of *printf, I had to comment out
 libintl_fprintf libintl_printf and libintl_sprintf
In intl/printf.c because these symbols conflict with symbols provided by -lintl

--

I suspect that "is_special_file_name" in src/data/file-name.c should
be replaced with "fn_is_special" as "is_special_file_name" does not
occur anywhere else in pspp or indeed the web.

--

I had to make the following changes to the Makefile so that the test
.exes would be built correctly:

<       tests/libpspp/ll-test \
<       tests/libpspp/llx-test \
<       tests/libpspp/heap-test \
<       tests/libpspp/abt-test
---
      tests/libpspp/ll-test$(EXEEXT) \
      tests/libpspp/llx-test$(EXEEXT) \
      tests/libpspp/heap-test$(EXEEXT) \
      tests/libpspp/abt-test$(EXEEXT)

--

configure added "-Dunix" to the Makefile. This did not seem good.
(Perhaps configure was picking up the host environment).

--

I defined some file permission flags that have no meaning under
windows to be 0, if they are undefined. Sys/wait is not implemented on
windows, so I didn't try to load the library. limits.h is needed on
windows to define INT_MIN and INT_MAX

Index: src/data/missing-values.h
===================================================================
RCS file: /sources/pspp/pspp/src/data/missing-values.h,v
retrieving revision 1.6
diff -r1.6 missing-values.h
79a80,87

#ifndef S_IRGRP
#define S_IRGRP 0
#define S_IROTH 0
#define S_IWGRP 0
#define S_IWOTH 0
#endif

80a89

Index: src/data/por-file-writer.c
===================================================================
RCS file: /sources/pspp/pspp/src/data/por-file-writer.c,v
retrieving revision 1.8
diff -r1.8 por-file-writer.c
106a107,114

#ifndef S_IRGRP
#define S_IRGRP 0
#define S_IROTH 0
#define S_IWGRP 0
#define S_IWOTH 0
#endif

===================================================================
RCS file: /sources/pspp/pspp/src/ui/debugger.c,v
retrieving revision 1.2
diff -r1.2 debugger.c
26c26
< #include <sys/wait.h>
---
//#include <sys/wait.h>
38a39,40


Index: src/output/afm.c
===================================================================
RCS file: /sources/pspp/pspp/src/output/afm.c,v
retrieving revision 1.5
diff -r1.5 afm.c
35a36
#include <limits.h>


--
John C. McCabe-Dansted
PhD Student
University of Western Australia




reply via email to

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