[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#333488: linux-kernel-headers: Include of asm/atomic.h is broken when compiling with g++

Package: linux-kernel-headers
Version: 2.6.13+0rc3-1.1
Severity: important


Including asm/atomic.h breaks compilation with g++.
The simple example below cannot be compiled using g++ 4, 3.4 or 3.3 and
the error is always the same.

#include <asm/atomic.h>

int main()
 return 0;
-- CODE END --

Trying to compile I get the following errors:

/usr/include/asm/system.h:247: error: expected ‘,’ or ‘...’ before ‘new’
/usr/include/asm/system.h: In function ‘long unsigned int
__cmpxchg(volatile void*, long unsigned int, long unsigned int)’:
/usr/include/asm/system.h:250: error: ‘size’ was not declared in this
/usr/include/asm/system.h:254: error: expected type-specifier before ‘)’
/usr/include/asm/system.h:260: error: expected type-specifier before ‘)’
/usr/include/asm/system.h:266: error: expected type-specifier before ‘)’
/usr/include/asm/processor.h: In function ‘void load_esp0(tss_struct*,
/usr/include/asm/processor.h:486: error: ‘unlikely’ was not declared in
this scope

The real thing is that, I could get it compiled using earlier versions
of linux-kernel-headers.

The problem in system.h is quite easy to fix as g++ thinks the function
parameter new is recognized as a keyword. Changing it to new_ (and so on
in the function) solves the problem.
As for the definition of unlikely which is found somewhere in
linux/compiler.h but only if __KERNEL__ is defined. Defining this
manually for compilation creates more problems of redefinitions.

What can I do ?


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.utf8)

-- no debconf information

Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
T�chargez cette version sur http://fr.messenger.yahoo.com

Reply to: