This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: thoughts on martin's proposed patch for GCC and UTF-8
- To: eggert at twinsun dot com (Paul Eggert)
- Subject: Re: thoughts on martin's proposed patch for GCC and UTF-8
- From: Tim Hollebeek <tim at wagner dot princeton dot edu>
- Date: Wed, 9 Dec 1998 21:00:57 -0500 (EST)
- Cc: martin at mira dot isdn dot cs dot tu-berlin dot de, brolley at cygnus dot com, gcc2 at gnu dot org, egcs at cygnus dot com
Paul Eggert writes ...
>
> Really? Suppose I write the preprocessor line
>
> #if X == 1
>
> where X is some Japanese identifier, but I make the understandable
> mistake of using a FULLWIDTH DIGIT ONE (code FF11) instead of an ASCII 1.
> What you're saying is that the preprocessor is obliged to treat this
> line as if it were
>
> #if X == 0
>
> because undeclared preprocessor identifiers default to zero?
IMO, the problem here has nothing to do with Japanese, and everything
to do with the fact that this rule is error prone in general. I've
been meaning to implement -Wpreprocessor-undeclared for a while now.
In fact, there is an instance of a typo in the SGI standard header
files which has never been caught by any ANSI C compiler because if
this "undeclared macro == 0" rule, despite the fact that the rule only
exists to support source files which predate the existence of #ifdef.
gcc really should complain "undeclared identifier 'x' in preprocessor
conditional expression has value 0" when -Wall is specified. Only
BASIC and perl programmers, and Fortran programmers who don't use
"implicit none", should have to worry about creating new variables
every time they make a typo.
---------------------------------------------------------------------------
Tim Hollebeek | "Everything above is a true
email: tim@wfn-shop.princeton.edu | statement, for sufficiently
URL: http://wfn-shop.princeton.edu/~tim | false values of true."