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: cygwin 1.5.24-2 gcc 3.4.4 stdio.h


Hi Robert.  Thanks for your reply.

> On Sun, 11 Nov 2007 03:50:28 -0500 (EST), Robert Kiesling wrote

>> I just downloaded cygwin 1.5.24-2 (just a couple of hours ago) and
>> compiled the following program with "gcc -ansi fred.c"
>> (NOTE the "-ansi" keyword):

> I have only the C99 standard in front of me, but its syntax should
> be the same as ANSI, which is:

> typedef-name:
> identifier

> and not,

> typedef-name:
> identifier1 identifier2... identifiern

> The compiler is looking for a semicolon after, "fred," and your 
> example is lacking a semicolon after, "here," anyway.

The compiler should never have been exposed to that typedef.
It is not part of the C89 standard.

> This is not the compiler's job - to demangle a possibly inconistent
> type statement. 

It is the compiler header's job (Cygwin in this case) to not expose
programs to non-C89 types when in ANSI mode.  If you go and
compile my code on some other C89 compiler, you should find that
it works, unless it has the same bug, anyway.

> It's the job of the parser and is potentially expensive 
> and invalid.

By the way, this mailing list is exposing email addresses over at:

http://www.omgili.com/mailinglist/cygwin/cygwin/com/0ce101c8240c3a5dea606501a8c0paul.html

I'll ask them to stop doing that.  I just got spammed.  :-(  Still, at least now
I know where to find replies.  :-)

BFN.  Paul.


----- Original Message ----- 
From: "Paul Edwards" <mutazilah@gmail.com>
To: <cygwin@cygwin.com>
Sent: Sunday, November 11, 2007 1:40 PM
Subject: cygwin 1.5.24-2 gcc 3.4.4 stdio.h


> I just downloaded cygwin 1.5.24-2 (just a couple of hours ago) and
> compiled the following program with "gcc -ansi fred.c"
> (NOTE the "-ansi" keyword):
> 
> #define pid_t fred was here
> 
> #include <stdio.h>
> 
> int main(void)
> {
>     printf("hello, world\n");
>     return (0);
> }
> 
> And got the following result:
> 
> In file included from /usr/include/stdio.h:46,
>                  from fred.c:3:
> /usr/include/sys/types.h:180: error: parse error before "was"
> In file included from /usr/include/sys/types.h:373,
>                  from /usr/include/stdio.h:46,
>                  from fred.c:3:
> /usr/include/cygwin/types.h:146: error: parse error before "fred"
> 
> 
> ie it is hitting a typedef for pid_t
> 
> 
> This is the compiler version:
> 
> gcc (GCC) 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
> Copyright (C) 2004 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> 
> Is "-ansi" not the correct thing to do to get pure ANSI C89 headers?
> 
> BFN.  Paul.
> 

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


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