Red Hat Bugzilla – Bug 154179
#include <asm/atomic.h> in userspace breaks
Last modified: 2013-07-02 23:05:29 EDT
Description of problem:
The inline ia64_atomic_add and ia64_atomic_sub functions in this header fail to compile under C++,
because they use "new" as a variable name ... and it's a reserved word in C++.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Try to build mysql on ia64 :=(
Please rename these variables ASAP ... I need to get mysql rebuilt ...
asm/atomic.c is a kernel-private header and may provide atomic operations which
do not work in userspace. It's perfectly entitled to not compile either. You
must not include it from userspace.
mysql has been depending on that header since 3.x days, and I doubt it's the only such app.
Shall I close all future mysql bugs as blocked by this one?
I'm not going to accept "I can't be bothered to respell 'new'" as an answer.
There's never been any guarantee that if you include this kernel-private header
it'll build. And there's _certainly_ never been any guarantee that if it builds,
what it does will actually be atomic in _userspace_.
Seriously, if we change this header it'll just be to add
#error KERNEL PRIVATE THINGS HERE.
I've had code which does *(((uint16_t *)p)++) for longer than that. Should I
file a compiler bug because it stopped working?