octave-maintainers
[Top][All Lists]
Advanced

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

Re: "dir" crashing oactve 3.2.0/mingw32


From: Benjamin Lindner
Subject: Re: "dir" crashing oactve 3.2.0/mingw32
Date: Thu, 13 Aug 2009 20:33:25 +0200
User-agent: Thunderbird 2.0.0.22 (Windows/20090605)


just back from holiday and catching up on unread emails.
thanks for the fix, it's of course the right thing to do.

benjamin


Hmm, the patch introduces a regression when building both 3.2.x and current development tip. At linking stage of liboctave ld.exe fails with missing symbols related to tzname.

I found that liboctave/strftime.c declares

#if HAVE_TZNAME
extern OCTAVE_IMPORT char *tzname[];
#endif

However, on mingw32, tzname[] is declared in <time.h> which is included by liboctave/strftime.c. The specific declaration in <time.h> does not match the one in strftime.c and I suppose the declaration in <time.h> is hidden by the declaration in strftime.c.

There is a config.h preprocessor macro HAVE_DECL_TZNAME, which according to config.h is defined if a tzname declaration is present. So the double-declaration is redundant and in the case of mingw32 breaks linking.

My suggestion is to change strftime.c to

#if HAVE_TZNAME && !HAVE_DECL_TZNAME
extern OCTAVE_IMPORT char *tzname[];
#endif

as the attached changeset does.

benjamin

# HG changeset patch
# User Benjamin Lindner <address@hidden>
# Date 1250187632 -7200
# Node ID fba4a85c73af16413b28ae284c4d897f3f23d961
# Parent  8cf7b375ad6f0428fc99a8ed1b99f82db99b03a5
skip double declaration of tztime

diff -r 8cf7b375ad6f -r fba4a85c73af liboctave/strftime.c
--- a/liboctave/strftime.c      Thu Aug 13 19:24:34 2009 +0200
+++ b/liboctave/strftime.c      Thu Aug 13 20:20:32 2009 +0200
@@ -49,7 +49,7 @@
 # endif
 #endif
 
-#if HAVE_TZNAME
+#if HAVE_TZNAME && !HAVE_DECL_TZNAME
 extern OCTAVE_IMPORT char *tzname[];
 #endif
 

reply via email to

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