Re: HDF5 and timezone

2008-01-23 Thread Corinna Vinschen
On Jan 23 15:17, Mark Hadfield wrote:
 Building HDF5 (either the recently released RC1 or the previous beta 5)
 under Cygwin fails with

 gcc -DHAVE_CONFIG_H -I. -DNDEBUG -UH5_DEBUG_API -std=c99 -pedantic -Wall 
 -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual 
 -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Waggregate-return 
 -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations 
 -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wfloat-equal 
 -Wmissing-format-attribute -Wmissing-noreturn -Wpacked 
 -Wdisabled-optimization -Wmultichar -Wendif-labels 
 -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch -O 
 -fomit-frame-pointer -finline-functions -MT H5Omtime.lo -MD -MP -MF 
 .deps/H5Omtime.Tpo -c H5Omtime.c -o H5Omtime.o
 H5Omtime.c: In function `H5O_mtime_decode':
 H5Omtime.c:194: warning: implicit declaration of function `tzset'
 H5Omtime.c:194: warning: nested extern declaration of `tzset'
 H5Omtime.c:230: error: `timezone' undeclared (first use in this function)
 H5Omtime.c:230: error: (Each undeclared identifier is reported only once
 H5Omtime.c:230: error: for each function it appears in.)

 Back on 27 November 2007 I built beta 5 with no problems.

 Is this likely to be related to the new Cygwin versions released in 
 December? I can see some discussion of timezone and tzset on the list 
 archives in the last couple of months, but don't know whether they relate 
 to my problem.

Earlier versions of Cygwin allowed to link against a very old,
very non-standard, timezone() function.  Since Cygwin 1.5.25,
the timezone() function is only available as exported symbol for
old applications built against earlier Cygwin release.

For new applications, timezone is only available as variable of
type long, according to POSIX.  See

  http://www.opengroup.org/onlinepubs/009695399/functions/timezone.html

I assume that HDF5 special cases the usage of timezone as being a
function for Cygwin.  Remove this code and use the timezone variable as
on other POSIX compliant systems.  Make sure that time.h gets included
before using the timezone variable.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: HDF5 and timezone

2008-01-23 Thread Mark Hadfield
[Sorry, but this message will be wrongly threaded on the archive, as it 
is being sent as a reply to my original message, rather than to 
Corinna's response. I neglected to subscribe to the list before sending, 
a neglect that I have now remedied.]


Thanks for this response, Corinna:

http://cygwin.com/ml/cygwin/2008-01/msg00449.html

I have worked around the problem with HDF5 and reported the problem to 
the maintainers. I expect they will want to support both 1.5.25 and 
earlier versions. How long has the POSIX-compliant

form of timezone been available?


--
Mark Hadfield  Ka puwaha te tai nei, Hoea tahi tatou
[EMAIL PROTECTED]
National Institute for Water and Atmospheric Research (NIWA)




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: HDF5 and timezone

2008-01-23 Thread Corinna Vinschen
On Jan 24 10:19, Mark Hadfield wrote:
 I have worked around the problem with HDF5 and reported the problem to the 
 maintainers. I expect they will want to support both 1.5.25 and earlier 
 versions. How long has the POSIX-compliant
 form of timezone been available?

The timezone variable has been around since 1997, but it's called
_timezone for historical reasons.  Prior to 1.5.25 there was a

  # ifndef timezonevar
  char *timezone (void);
  # elif !defined(timezone)
  #   define timezone _timezone
  # endif
  #endif /*__STRICT_ANSI__*/

so you have to `#define timezonevar' to get the timezone variable.  The
problem is that this collides potentially with the definition of struct
timezone.  1.5.25 now defines timezone like this:

  extern long timezone __asm__ (__timezone);

In theory (and if the code doesn't use the struct timezone) the below
code should be portable and should work fine with any version of Cygwin:

  #ifdef __CYGWIN__
  #define timezonevar
  #endif
  #include time.h
  [... use timezone variable ...]


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



HDF5 and timezone

2008-01-22 Thread Mark Hadfield

Building HDF5 (either the recently released RC1 or the previous beta 5)
under Cygwin fails with

gcc -DHAVE_CONFIG_H -I. -DNDEBUG -UH5_DEBUG_API -std=c99 -pedantic -Wall 
-Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual 
-Wcast-align -Wwrite-strings -Wconversion -Wsign-compare 
-Waggregate-return -Wstrict-prototypes -Wmissing-prototypes 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline 
-Wno-long-long -Wfloat-equal -Wmissing-format-attribute 
-Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wmultichar 
-Wendif-labels -Wdeclaration-after-statement -Wold-style-definition 
-Winvalid-pch -O -fomit-frame-pointer -finline-functions -MT H5Omtime.lo 
-MD -MP -MF .deps/H5Omtime.Tpo -c H5Omtime.c -o H5Omtime.o

H5Omtime.c: In function `H5O_mtime_decode':
H5Omtime.c:194: warning: implicit declaration of function `tzset'
H5Omtime.c:194: warning: nested extern declaration of `tzset'
H5Omtime.c:230: error: `timezone' undeclared (first use in this function)
H5Omtime.c:230: error: (Each undeclared identifier is reported only once
H5Omtime.c:230: error: for each function it appears in.)

Back on 27 November 2007 I built beta 5 with no problems.

Is this likely to be related to the new Cygwin versions released in 
December? I can see some discussion of timezone and tzset on the list 
archives in the last couple of months, but don't know whether they 
relate to my problem.


I generally keep my Cygwin installation up to data and right now I have

$ cygcheck -c cygwin

Cygwin Package Information
Package  VersionStatus
cygwin   1.5.25-7   OK



--
Mark Hadfield  Ka puwaha te tai nei, Hoea tahi tatou
[EMAIL PROTECTED]
National Institute for Water and Atmospheric Research (NIWA)




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/