[lkml]   [2001]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: Advice on Unsigned Types
    Followup to:  <>
    By author: John Kacur <>
    In newsgroup:
    > The advice the author give on Unsigned Types is:
    > "Avoid unnecessary complexity by minimizing your use of unsigned types.
    > Specifically, don't use an unsigned type to represent a quantity just
    > because it will never be negative (e.g."age" or "national debt").
    > Use a signed type like int and you won't have to worry about boundary
    > cases in the detailed rules for promoting mixed types.
    > Only use unsigned types for bitfields or binary masks. Use casts in
    > expressions, to make all the operands signed or unsigned, so the
    > compiler does not have to choose the result type."

    So the author isn't talking about developing operating systems. In
    operating systems it's almost the other way around -- signed is really
    the exception.

    <> at work, <> in private!
    "Unix gives you enough rope to shoot yourself in the foot." <>
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:02    [W:0.022 / U:33.008 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site