Re: >>/<< 32 Bit wrong on 32 architechture

From: Benjamin Riefenstahl (Benjamin.Riefenstahl_at_epost.de)
Date: 12/30/03

  • Next message: Torsten Mohr: "Re: Building Tcl/Tk as a static library on Windows"
    Date: Tue, 30 Dec 2003 00:30:17 +0100
    
    

    Hi David,

    David Gravereaux <davygrvy@pobox.com> writes:
    > What's the C standard say on the rules of shifting?

    In C89 the result of

      a << b and a >> b

    is explicitly undefined if

      b >= (CHAR_BITS * sizeof(a)) || b < 0

    In addition the result of

      a >> b

    is implementation defined, if

      a < 0

    benny


  • Next message: Torsten Mohr: "Re: Building Tcl/Tk as a static library on Windows"

    Relevant Pages

    • Re: >>/<< 32 Bit wrong on 32 architechture
      ... >> What's the C standard say on the rules of shifting? ... Regardless what C89 Standard says, this is quite an unusable result, ... and does not lead to clean and readable code: e.g. shift a right b ...
      (comp.lang.tcl)
    • Re: >>/<< 32 Bit wrong on 32 architechture
      ... > What's the C standard say on the rules of shifting? ... In C89 the result of ...
      (comp.lang.tcl)
    • Re: How to convert Infix notation to postfix notation
      ... covers ANSI C, so I'm taking that as my baseline. ... The Standard does, however, say that "The implementation shall provide ... C89 Standard specifies 15 standard headers, ... The implementation is required to provide unique mappings to ...
      (comp.lang.c)
    • Re: Objects
      ... the standard, not by K&R2, ... is a feature of the language proper in C99, but not in C89. ... A region of data storage in the execution ...
      (comp.lang.c)
    • Re: ISO C89 and ISO C99
      ... >> When people say C programming language, they mean ISO C89? ... This is the original 1989 C standard, ... The new ISO standard was immediately "back-adopted" by ANSI. ...
      (comp.lang.cpp)