[15644] in Athena Bugs
Re: sun4 8.1.11: system header files: _POSIX_SOURCE and /usr/include/sys/stat.h
daemon@ATHENA.MIT.EDU (Darrin Jewell)
Tue Nov 4 11:48:55 1997
Date: Tue, 4 Nov 1997 11:42:11 -0500
To: bugs@MIT.EDU
From: Darrin Jewell <jewell@MIT.EDU>
Cc: Darrin Jewell <jewell@MIT.EDU>, gnu@MIT.EDU
A more careful examination of the header files that
were breaking in this bug report (included below
for reference) revealed that the problem is likely
that the gnu locker version of gcc is using header
files that were fixinclude'd from an old version
of solaris (version 2.3)
Thanks to jhawk for noticing this.
The sunsoft compiler in /usr/athena/bin/cc appears
to compile my test program fine.
Darrin
>System name: portnoy
>Type and version: SPARC/5 8.1.11 (with mkserv)
>Display type: cgthree
>
>What were you trying to do?
>
>Compile the following program:
>
>#define _POSIX_SOURCE
>#include <sys/types.h>
>#include <sys/stat.h>
>int
>main(int argc, char *argv[])
>{
> time_t t;
> int r;
> struct stat stat_buf;
> r = stat(".",&stat_buf);
> t = stat_buf.st_mtime;
> return(0);
>}
>
>Example compile:
>
>%gcc foo.c
>foo.c: In function `main':
>foo.c:14: structure has no member named `tv_sec'
>
>What's wrong:
> I think the system header files are broken when
>_POSIX_SOURCE is defined.
>
>What should have happened:
> The program should have compiled without error.
>(I think; Please correct me if I'm wrong.)
>
>Please describe any relevant documentation references:
> the POSIX Specification, Part 1: The C Language API
> (ISO/IEC 9945-1 / ANSI/IEEE std 1003.1)
> second edition 1996-07-12
>--[15643]--