Re: [cc65] possible bug in cbm_dir.c

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2004-07-06 23:46:16
Hi!

On Tue, Jul 06, 2004 at 11:42:16PM +0200, Groepaz wrote:
> cbm_dir.c(48): Warning: Shift count too large for operand type
>
> the return value of a kernal routine, which i believe is an
> unsigned char, is shifted to the left by 8. i would think that
> the proper way to fix it would be changing the line into this:
>
> l_dirent->size = byte | (((unsigned short)cbm_k_basin())<<8);

No, it is a bug in the development code, and it is already fixed. The left
hand side operand of the shift operators is promoted to an integer before the
shift takes place. The new shift code in the compiler didn't do the int
promotion before the check that led to the warning.

If you don't need cbm_dir, you can ignore the warning for now, otherwise you
this nights snapshot, because the compiler generates a zero result when the
warning is output, which is wrong in this place.

> ps: what about testing for the existance of sgml2html etc in
> the toplevel makefile and skipping the building of the docs
> if its not present?

Just send me a patch and I will apply it:-)

Thanks for testing the development snapshot!

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Jul 6 23:46:22 2004

This archive was generated by hypermail 2.1.8 : 2004-07-06 23:46:31 CEST