Bug 232227 - Can't compile <linux/cdrom.h> in C++ with -pedantic.
Can't compile <linux/cdrom.h> in C++ with -pedantic.
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
5.0
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Red Hat Kernel Manager
Martin Jenner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-03-14 10:26 EDT by Scott Bambrough
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-09-05 18:15:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Scott Bambrough 2007-03-14 10:26:05 EDT
To reproduce compile the following code using g++.

//file: test.cpp
#include <linux/cdrom.h>
int main(int argc, char **argv) {
  return 0;
}

Compiling the above with gcc 4.11 on RedHat 5 RC1 yields:

g++ -o test test.cpp
This compile succeeds.

g++ -pedantic -o test test.cpp
This compile fails with errors in <linux/byteorder/swab.h>

/usr/include/linux/byteorder/swab.h: In function ‘__u16 __fswab16(__u16)’:
/usr/include/linux/byteorder/swab.h:134: error: ISO C++ forbids
/braced-groups within expressions
/usr/include/linux/byteorder/swab.h:134: error: ISO C++ forbids
/braced-groups within expressions
/usr/include/linux/byteorder/swab.h: In function ‘__u16 __swab16p(const
/__u16*)’:
/usr/include/linux/byteorder/swab.h:138: error: ISO C++ forbids
/braced-groups within expressions
/usr/include/linux/byteorder/swab.h:138: error: ISO C++ forbids
/braced-groups within expressions
/usr/include/linux/byteorder/swab.h: In function ‘void __swab16s(__u16*)’:
/usr/include/linux/byteorder/swab.h:142: error: ISO C++ forbids
/braced-groups within expressions
/usr/include/linux/byteorder/swab.h:142: error: ISO C++ forbids
/braced-groups within expressions
Comment 1 Ernie Petrides 2007-09-05 18:15:40 EDT
Being able to compile kernel-private header files in C++ is not a requirement.

Note You need to log in before you can comment on or make changes to this bug.