This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]