Re: problem with compiling BrDb.cxx

From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Mon Mar 19 2001 - 15:38:56 EST

  • Next message: Christian Holm Christensen: "Re: problem with compiling BrDb.cxx"

    Hi Kris et al, 
    
    On Mon, 19 Mar 2001 12:06:34 -0600
    hagel@comp.tamu.edu wrote
    concerning ": Re: problem with compiling BrDb.cxx":
    > Does the Char_t declaration not take into account signed and unsignedness of
    > the variables?  In particular, I thought if you used Char_t, it would always
    > be signed and if you used UChar_t, it would always be unsigned?
    
    You're right it should be like that, but looking in Rtypes.h I see, 
    
      typedef char           Char_t;      //Signed Character 1 byte
    
    which would mean that "Char_t" is signed or unsigned, depending on the
    architecture. Here's what the C++ ANSI/ISO standard has to say on the
    signedness of "char" (section 3.9.1): 
    
      Object declared character (char) shall be large enough to store any
      member of the implementation's basic character set. 
      ...
      It is implementationdefined wether a char can hold negative values. 
    
    So it's ANSI/ISO style not to specify the signedness of a char. Maybe
    ROOT should take care to make "Char_t" signed. 
    
    Anyway, I didn't use "Char_t" but plain "char", since I was dealing
    with some C code, so I decided to be native. 
    
    Also,  you may notice, that some places in the ROOT code you'll find
    "const char*" instead of "const Char_t*". As far as I remember, Rene
    told me there was some protability issue there preventing the use of
    "Char_t", but I can't remember what, and I haven't seen it in BRAT, so
    I may be wrong. 
    
    Yours, 
    
    Christian  -----------------------------------------------------------
    Holm Christensen                             Phone:  (+45) 35 35 96 91 
      Sankt Hansgade 23, 1. th.                  Office: (+45) 353  25 305 
      DK-2200 Copenhagen N                       Web:    www.nbi.dk/~cholm    
      Denmark                                    Email:       cholm@nbi.dk
    



    This archive was generated by hypermail 2b29 : Mon Mar 19 2001 - 15:39:41 EST