[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc
Subject:    Re: undefined reference to `__setbits'
From:       Andreas Schwab <schwab () suse ! de>
Date:       1999-09-30 9:57:55
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic