Mail Archives: djgpp/1997/10/29/14:36:45
Roman Suzi wrote:
> >I think you are missing the fact that '\xFD' is NOT a character
> > constant,
> >it's an int. Therefore, -funsigned-char doesn't affect it.
>
> NO!!! It has sizeof('\xFD') == 1
>
> I have just checked it.
Then you must be using C++ instead of C. In C, a character constant is
of type int, not char.
> Possibly, the fact, that my file is probe.cc
> and not probe.c ?
Yep, C++ and not C.
> >If you want avoid trouble always use explicit casts in these cases.
> -- Then the program will be a nightmare...
>
> OK. I can use:
>
> #define UC (unsigned char)
>
> ..
>
> c = UC'\xFD'
>
> No problem here.
There's little worse than making #defines so that C/C++ looks like a
different language. Don't be such a baby -- writing explicit casts that
are clear and unambiguous is a sign of _good_ programming.
--
Erik Max Francis, &tSftDotIotE / mailto:max AT alcyone DOT com
Alcyone Systems / http://www.alcyone.com/max/
San Jose, California, United States / icbm://+37.20.07/-121.53.38
\
"After each war there is a little / less democracy to save."
/ Brooks Atkinson
- Raw text -