Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 94119 - linux/list.h in linux-headers-2.6.11 is not C++-compatible
Summary: linux/list.h in linux-headers-2.6.11 is not C++-compatible
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Tim Yamin (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-26 14:30 UTC by Felix Riemann
Modified: 2005-06-17 15:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Riemann 2005-05-26 14:30:44 UTC
The file "liux/list.h" is not compatible with C++-code since the function "list_replace_rcu" uses the word "new" as a variable name. C++-code which includes this file fails to compile because "new" is a reserved word in C++.

It can for example be triggered with dev-libs/tvision:

In file included from /usr/include/linux/wait.h:21,
                 from /usr/include/linux/keyboard.h:14,
                 from ../classes/linux/linuxmouse.cc:34:
/usr/include/linux/list.h:222: Fehler: expected `,' or `...' vor "new"
/usr/include/linux/list.h: In function `void list_replace_rcu(list_head*, list_head*)':
/usr/include/linux/list.h:223: Fehler: expected identifier vor 
Comment 1 Felix Riemann 2005-05-26 14:30:44 UTC
The file "liux/list.h" is not compatible with C++-code since the function "list_replace_rcu" uses the word "new" as a variable name. C++-code which includes this file fails to compile because "new" is a reserved word in C++.

It can for example be triggered with dev-libs/tvision:

In file included from /usr/include/linux/wait.h:21,
                 from /usr/include/linux/keyboard.h:14,
                 from ../classes/linux/linuxmouse.cc:34:
/usr/include/linux/list.h:222: Fehler: expected `,' or `...' vor "new"
/usr/include/linux/list.h: In function `void list_replace_rcu(list_head*, list_head*)':
/usr/include/linux/list.h:223: Fehler: expected identifier vor »->«-Zeichen
/usr/include/linux/list.h:223: Fehler: expected `;' vor »->«-Zeichen
/usr/include/linux/list.h:224: Fehler: expected identifier vor »->«-Zeichen
/usr/include/linux/list.h:224: Fehler: expected `;' vor »->«-Zeichen
/usr/include/linux/list.h:226: Fehler: expected identifier vor »->«-Zeichen
/usr/include/linux/list.h:226: Fehler: expected `;' vor »->«-Zeichen
/usr/include/linux/list.h:227: Fehler: expected identifier vor »->«-Zeichen
/usr/include/linux/list.h:227: Fehler: expected `;' vor »->«-Zeichen

A possible fix would be to change all "new"s in this function to "_new". This would fit to the other functions in list.h which already use this form.

This seems to affect kernel-headers down to version 2.6.9:
http://www.kernel.org/diff/diffview.cgi?file=%2Fpub%2Flinux%2Fkernel%2Fv2.6%2Fpatch-2.6.9.bz2;z=3797
Comment 2 Tim Yamin (RETIRED) gentoo-dev 2005-06-17 14:36:42 UTC

*** This bug has been marked as a duplicate of 96413 ***
Comment 3 Tim Yamin (RETIRED) gentoo-dev 2005-06-17 15:14:49 UTC
Fixed in 2.6.11-r2.
Comment 4 Tim Yamin (RETIRED) gentoo-dev 2005-06-17 15:14:59 UTC
Fixed in 2.6.11-r2.