[uClibc] time.h

Stuart Hughes seh at zee2.com
Wed Jul 2 16:12:18 UTC 2003


Greetings,

I had a problem with struct tm in time.h when compiling with a c++
compiler (mipsel-uclibc-g++).
If a declaration is: struct tm; (uninitialised)

The compiler complains and fails: 

<filename>.cpp:line: structure
   `timeStruct' with uninitialized const members

Looking at glibc they have a slight difference.  I've attached a patch
that changes the uclibc file to be like glibc, and this stops the error.

Regards, Stuart
-------------- next part --------------
--- time.h.orig	Wed Jul  2 16:52:57 2003
+++ time.h	Wed Jul  2 16:54:45 2003
@@ -130,10 +130,10 @@
 #ifdef __UCLIBC_HAS_TM_EXTENSIONS__
 # ifdef	__USE_BSD
   long int tm_gmtoff;		/* Seconds east of UTC.  */
-  __const char tm_zone[8];	/* Timezone abbreviation.  */
+  __const char *tm_zone;	/* Timezone abbreviation.  */
 # else
   long int __tm_gmtoff;		/* Seconds east of UTC.  */
-  __const char __tm_zone[8];/* Timezone abbreviation.  */
+  __const char *__tm_zone;	/* Timezone abbreviation.  */
 # endif
 #endif /* __UCLIBC_HAS_TM_EXTENSIONS__ */
 };


More information about the uClibc mailing list