This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Issues with stdio.h


Am 20.02.2012 23:10, schrieb Eric Blake:
On 02/20/2012 02:39 PM, Thomas Wolff wrote:
Am 20.02.2012 01:25, schrieb Christopher Faylor:
On Sun, Feb 19, 2012 at 07:07:04PM -0500, Chris Sutcliffe wrote:
...
/usr/include/stdio.h:34:20: fatal error: stddef.h: No such file or
directory
stddef.h comes from the gcc4-core package. It's located in:

usr/lib/gcc/i686-pc-cygwin/4.5.3/include/stddef.h

and should be found automatically by the compiler.
I think it's a weird setup that an include file referred from
/usr/include is not found in that location but well hidden in
installation-specific directories. Not the usual setup anyway.
Wrong. GNU/Linux does this too. On my Fedora machine,

$ printf '#include<stddef.h>\n#include<stdio.h>\n' | gcc -E -\
    |grep '^# 1 "/'
# 1 "/usr/lib/gcc/x86_64-redhat-linux/4.6.2/include/stddef.h" 1 3 4
# 1 "/usr/include/stdio.h" 1 3 4
# 1 "/usr/include/features.h" 1 3 4
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 1 "/usr/include/gnu/stubs.h" 1 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 1 "/usr/include/gnu/stubs-64.h" 1 3 4
# 1 "/usr/lib/gcc/x86_64-redhat-linux/4.6.2/include/stddef.h" 1 3 4
# 1 "/usr/include/bits/types.h" 1 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 1 "/usr/include/bits/typesizes.h" 1 3 4
# 1 "/usr/include/libio.h" 1 3 4
# 1 "/usr/include/_G_config.h" 1 3 4
# 1 "/usr/lib/gcc/x86_64-redhat-linux/4.6.2/include/stddef.h" 1 3 4
# 1 "/usr/include/wchar.h" 1 3 4
# 1 "/usr/lib/gcc/x86_64-redhat-linux/4.6.2/include/stdarg.h" 1 3 4
# 1 "/usr/include/bits/stdio_lim.h" 1 3 4
# 1 "/usr/include/bits/sys_errlist.h" 1 3 4
	
So it is quite a common practice, and cygwin is merely copying what you
get on a GNU/Linux box.

Also
uncomfortable for people who want to check include files manually.
How so?  As far back as C89, and reiterated in newer documents such as
POSIX 2008, there is no guarantee that<stddef.h>  is an actual file that
lives in any particular directory, only that the<>  notation in the
#include directive tells the compiler to find whatever it needs to
provide that standard header.
JonY wrote:
So how are you supposed to use headers provided by the compiler anyway
without going into that compiler specific directory?

As I interpret this, stddef.h - containing those constants - is the only file with this setup, so be it.
(I had actually checked on a SunOS system.)
Thomas


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]