delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/02/20/17:10:47

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4F42C4D0.8050108@redhat.com>
Date: Mon, 20 Feb 2012 15:10:24 -0700
From: Eric Blake <eblake AT redhat DOT com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120209 Thunderbird/10.0.1
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Issues with stdio.h
References: <CAGHJv4e-Zbqqg-9um+viGKHuajnZdr7AjyXeh16c7A__Lm+V4A AT mail DOT gmail DOT com> <20120220002507 DOT GA16123 AT ednor DOT casa DOT cgf DOT cx> <4F42BDAE DOT 50006 AT towo DOT net>
In-Reply-To: <4F42BDAE.50006@towo.net>
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------enig00D64D110D57153EB82505FB
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

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
=09
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.

> Please consider to change this (gcc maintainer?).

I don't see the need for any change.

--=20
Eric Blake   eblake AT redhat DOT com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--------------enig00D64D110D57153EB82505FB
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJPQsTQAAoJEKeha0olJ0NqHvQIAKJp1ZB331JtlgEy0V6wtNnL
eKYPiRC/ad/kZqJ6JVYMEr3bloXMEtAcYz6mC9G9jhD25DbwwlY+aA24lidoOfG1
U55mjtGCTuTN20I+zfflSnYv1i8wgRG6pAm3rR6XoFnRH99nHSHqrbDGSB98sqem
AICSnKa/FH0kJtmMyTZItvU7fpkFV9jwODNThKC1jL3pIsUYK3ToScBR3uRdB5Nz
Agch8Osxy33SHpljQG1G9dUqpcXSywUEEqhagjSM2i16SMlgwNe0O6FQqqhcFXdb
0DqZkEji3/YA6ba0fpqKAqeIMnLOlQTEql1KILvEPTtTH9gb8jjGWXKNwZWN1nQ=
=+imi
-----END PGP SIGNATURE-----

--------------enig00D64D110D57153EB82505FB--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019