c/8379: bits/byteswap.h mistakenly redefines __bswap_16 instead of __bswap_32 when using constant definition

fabio.torchetti@sun.com fabio.torchetti@sun.com
Mon Oct 28 06:06:00 GMT 2002


>Number:         8379
>Category:       c
>Synopsis:       bits/byteswap.h mistakenly redefines __bswap_16 instead of __bswap_32 when using constant definition
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          mistaken
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 28 05:56:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Fabio Torchetti
>Release:        gcc (GCC) 3.2
>Organization:
>Environment:
Linux/RH8.0 default installation
>Description:
In bits/byteswap.h we have the following fallback in case the compiler is not running on __GNUCC_ > 2 (...or this is not defined.):

Line 83:
#else
# define __bswap_16(x) \
     (__extension__                                                           \
      ({ register unsigned int __x = (x); __bswap_constant_32 (__x); }))
#endif

This should actually be:

#else
# define __bswap_32(x) \
     (__extension__                                                           \
      ({ register unsigned int __x = (x); __bswap_constant_32 (__x); }))
#endif

...or so I guess.
>How-To-Repeat:
Just compile anything without defining __GNUCC__ > 2
>Fix:
As shown above

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list