public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Thomas Wolff <towo@towo.net>
To: cygwin@cygwin.com
Subject: Re: Issues with stdio.h
Date: Mon, 20 Feb 2012 22:58:00 -0000	[thread overview]
Message-ID: <4F42CFFD.2040403@towo.net> (raw)
In-Reply-To: <4F42C4D0.8050108@redhat.com>

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

  reply	other threads:[~2012-02-20 22:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-20  0:07 Chris Sutcliffe
2012-02-20  0:25 ` Christopher Faylor
2012-02-20 21:40   ` Thomas Wolff
2012-02-20 22:10     ` Eric Blake
2012-02-20 22:58       ` Thomas Wolff [this message]
2012-02-20 23:05         ` Eric Blake
2012-02-20 22:12     ` JonY
2012-02-20 22:58       ` Robert Miles
2012-02-20 23:08         ` Eric Blake
2012-02-21  1:10         ` Christopher Faylor
2012-02-21 13:01           ` Earnie Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F42CFFD.2040403@towo.net \
    --to=towo@towo.net \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).