www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Obsolete -Ju ?

↑ ↓ ← 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
↑ ↓ → "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