This is the mail archive of the cygwin@sourceware.cygnus.com 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]

Re: ANSI compliance problem


In a message dated 11/30/99 9:02:27 AM Pacific Standard Time, 
cygnus@ncohafmuta.com writes:

> In ctype.h:
>  
>  #ifdef __GNUC__
>  # define toupper(c) \
>          ({ int __x = (c); islower(__x) ? (__x - 'a' + 'A') : __x;})
>  
>  this shouldn't be done with the {}s. I dont know how it should be fixed,
>  just that it shouldn't be done. :)
If you object to use of gcc extensions in ctype.h, you could look in 
textbooks such as Plauger's "Standard C Library" for more portable 
alternatives.  But, if you wished gcc to restrict itself to ansi compatible 
pre-processing, you could have told it so, e.g. with -ansi.  If you did that 
and got warning about non-ansi headers, you might have a case for a bug 
report, but it ought to be easy enough for you to qualify this #ifdef with 
__STRICT_ANSI__ as well as __GNUC__ if you believe that is needed.

Tim
tprince@computer.org

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


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