Menu

#2422 Z80: bogus right shift warning when object being shifted is 0

closed-fixed
Ben Shi
None
Front-end
5
2015-10-02
2015-10-01
Alan Cox
No

int x = 1 + (0 >> 9);

produces the error message

warning 116: right shifting more than size of object changed to zero

In the real case the 0 is a macro that is sometimes zero and sometimes not. Casting 0 to uint16_t works around the bug

Discussion

  • Alan Cox

    Alan Cox - 2015-10-01

    SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.5.0 #9253 (Jul 4 2015) (Linux)

     
  • Ben Shi

    Ben Shi - 2015-10-02

    Fixed in reversion #9337.

     
  • Ben Shi

    Ben Shi - 2015-10-02
    • status: open --> closed-fixed
    • assigned_to: Ben Shi
    • Category: Z80 --> Front-end
     

Log in to post a comment.