This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: undefined reference to `__setbits'
Peter Gerwinski <peter@gerwinski.de> writes:
|> Anyway: Are you sure that this `__setbits()' function works
|> correctly in Chill? The following looks like a very obvious bug
|> for me:
|>
|> #define SET_WORD unsigned char
|> #define SET_CHAR unsigned char
|> #define SET_SHORT unsigned char
|>
|> [...]
|>
|> #define SET_WORD_SIZE (sizeof (char) * sizeof (SET_WORD))
|> #define SET_SHORT_SIZE (sizeof (char) * sizeof (SET_SHORT))
|> #define SET_CHAR_SIZE sizeof (char)
I think this should rather be:
#define SET_WORD_SIZE (CHAR_BIT * sizeof (SET_WORD))
#define SET_SHORT_SIZE (CHAR_BIT * sizeof (SET_SHORT))
#define SET_CHAR_SIZE CHAR_BIT
Andreas.
--
Andreas Schwab "And now for something
SuSE Labs completely different."
schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg