www.digitalmars.com         C & C++   DMDScript  

c++ - Obsolete -Ju ?

reply Jean-Pierre H. Dumas <jeanpierre.dumas freesbee.fr> writes:
I have a slight problem with the now considered obsolete -Ju (and -J) sc option
(in C, not C++)
the code I write uses "unsigned char" only, like most people outside the US, as
I need to
use the char as index in vectors.And, yes, there are people that use char >127
every day.

So, "blahblah" is signed char *, it is a bit heavy to put (unsigned char *) in
front
of each "..." and '.' in programs, right ?

Then, when I call library functions, they are all declared signed char, in
parameters and result,
so casting again at all lines, really heavy.
(I do not feel like tweaking all system include files to get them correctly,
because at
each update I would have to do it again.)

If I want to compile without fatal errors I have to disable the type checking
with -Jm, 
then I loose the benefit of type checking, not nice if I want to create ANSI
clean code.

Some months ago -Ju was silent, now with the "obsolete" message it is rather
noisy.

So, as I don't believe that unsigned char are seen as a necessary standard, it
would
be nice just to have -Ju back to its former silent behavior, please.
(DMC must be the only remaining compiler with signed char by default, no ?)

Jean-Pierre
May 13 2003
parent "Walter" <walter digitalmars.com> writes:
"Jean-Pierre H. Dumas" <jeanpierre.dumas freesbee.fr> wrote in message
news:1103_1052855870 news.digitalmars.com...
 I have a slight problem with the now considered obsolete -Ju (and -J) sc

 the code I write uses "unsigned char" only, like most people outside the

 use the char as index in vectors.And, yes, there are people that use char
127 every day.

 So, "blahblah" is signed char *, it is a bit heavy to put (unsigned char

 of each "..." and '.' in programs, right ?

 Then, when I call library functions, they are all declared signed char, in

 so casting again at all lines, really heavy.
 (I do not feel like tweaking all system include files to get them

 each update I would have to do it again.)

 If I want to compile without fatal errors I have to disable the type

 then I loose the benefit of type checking, not nice if I want to create

 Some months ago -Ju was silent, now with the "obsolete" message it is

 So, as I don't believe that unsigned char are seen as a necessary

 be nice just to have -Ju back to its former silent behavior, please.
 (DMC must be the only remaining compiler with signed char by default, no

The problem with -Ju is it plays type havoc with the headers and libraries. It's not well tested anymore, and I wasn't sure it was reliable. I had several programs myself that relied on -Ju, and I recoded them to not rely on the signed-ness of char. Where char is used as an index, I just: array[c] => array[c & 0xFF] DMC is signed char by default to be compatible with common practice on the PC.
May 13 2003