Bug 77689 - bug of /usr/include/bits/byteswap.h
Summary: bug of /usr/include/bits/byteswap.h
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc
Version: 8.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2002-11-12 04:40 UTC by Zhixu Liu
Modified: 2016-11-24 14:56 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-01-07 16:54:50 UTC

Attachments (Terms of Use)

Description Zhixu Liu 2002-11-12 04:40:37 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461)

Description of problem:
If I'm right, the include file /usr/include/bits/byteswap.h (line 84-86, 
45-47) in  glibc-devel-2.2.93-5 for RedHat 8.0 have some bugs:

1.  #define __bswap_16(x) should be #define __bswap_32(x), otherwise if 
__GNUC__ is not defined, i.e, people use compiler other than gcc, 
__bswap32(x) will not be defined!
2. After change __bswap_16 to __bswap_32, the macro define should change 
to "# define __bswap_32(x) __bswap_constant_32 (x)". The __extension__ is 
a GNU extension, right? At least, intel compiler (icc) doesn't support it.

The same for the definition of macro __bswap_16 (line 45-47).

To make sure this is not a redhat bug, I download 
http://ftp.gnu.org/gnu/glibc/glibc-2.3.1.tar.gz, and found the same bug in 

Is that right? Thanks!

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Just try to compile a program which use htonl ... with non-GCC compilers,
such as icc, ...	

Actual Results:  It won't pass the compile, as I've said in the description

Additional info:

Comment 1 Matt 2002-11-27 21:13:50 UTC
I think I have a similar problem. I'm using an Intel compiler to compile a
program  which worked just fine under Redhat 7.3. Now when I compile I get  the
following error:

ifc  -O3 -tpp7 -Vaxlib -w95 -cm -static -r8  -o prism_static x86_prism4-0e_gui.o
-L/usr/lib -L./library/x86 -L../f90/library/x86 -lprism
./library/x86/libprism.a(create_socket.o): In function `create_socket_':
create_socket.o(.text+0x40): undefined reference to `__bswap_32'
make: *** [prism_static] Error 1

Comment 2 Jakub Jelinek 2003-01-07 16:54:50 UTC
Should be fixed in glibc-2.3.1-9 and later.

Note You need to log in before you can comment on or make changes to this bug.