Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 77689

Summary: bug of /usr/include/bits/byteswap.h
Product: [Retired] Red Hat Linux Reporter: Zhixu Liu <liuzx>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: fweimer, mitr
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-01-07 16:54:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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 
sysdeps/i386/bits/byteswap.h

Is that right? Thanks!


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


How reproducible:
Always

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.