include file problem (with patch)

From: S. Baker (sbaker@erols.com)
Date: Sun May 28 2000 - 20:13:27 EST


While trying to compile the following sample program using
'gcc -o testbo testbo.c' I encountered a problem in
include/linux/byteorder/swab.h that causes testbo not to
compile.

testbo:
#include <asm/byteorder.h>

main()
{
   int b;
   __u32 y = 5;

   b = __cpu_to_be32(y);
}

An interesting thing to note is that
gcc -O -o testbo testbo.c works fine, which I believe
is why this bug has gone undiscovered. The following is
a patch to fix this erroneous behavior:

diff -rc linux/include/linux/byteorder/swab.h patch/include/linux/byteorder/swab.h
*** linux/include/linux/byteorder/swab.h Mon May 15 17:06:32 2000
--- patch/include/linux/byteorder/swab.h Sun May 28 20:49:34 2000
***************
*** 90,98 ****
   ___swab64((x)) : \
   __fswab64((x)))
  #else
! # define __swab16(x) __fswab16(x)
! # define __swab32(x) __fswab32(x)
! # define __swab64(x) __fswab64(x)
  #endif /* OPTIMIZE */
  
  
--- 90,98 ----
   ___swab64((x)) : \
   __fswab64((x)))
  #else
! # define __swab16(x) ___swab16(x)
! # define __swab32(x) ___swab32(x)
! # define __swab64(x) ___swab64(x)
  #endif /* OPTIMIZE */
  
  



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:20 EST