On January 26, niall at linux.ie said:
> OK - this tiny program
>> ---------------------
> #include <sys/time.h>
>> main() {
> struct tm *tp;
>> tp = localtime();
> tp->tm_isdst;
> }
> ---------------------
>> generates the following wrning and error
>> timeq.c: In function main':
> timeq.c:8: warning: assignment makes pointer from integer without a cast
> timeq.c:9: dereferencing pointer to incomplete type
>> when compiled on a SuSE 7.3 box with gcc 2.95.3 and glibc 2.2.4
>> It compiles with no warning or error on a SuSE 6.4 box with gcc 2.95.2 and
> libc 2.1.3 (yes, libc, not glibc - seems like a strange libc version number
> to me)
>> While I'm no C whizkid, nor am I C illiterate and I just don't understand
> these errors. I have
incomplete type means that the struct has been declared but not
defined. In your code snippet, you're declaring tp to be a pointer to
a struct tm, but it looks like the definition of the tm struct has
been removed from sys/time.h. You may find it's been relocated to
/usr/include/time.h; poking around in /usr should turn it up.
Cheers,
Waider.
--
waider at waider.ie / Yes, it /is/ very personal of me.
"for god's sake, give me some credit. i may be an egocentric jerk, but i'm
not a COMPLETE asshole." - Meredith
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!