c++ keyword "private" in unicap.h
Bug #658739 reported by
dogguts
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
unicap |
Fix Committed
|
Medium
|
Arne Caspari | ||
libunicap (Fedora) |
Fix Released
|
Medium
|
Bug Description
revision 65 of unicap.h introduced "private" in the "_unicap_
Unfortunately this prevents unicap from being used (~unicap.h being included) with a C++ compiler, since "private" is a keyword in C++ (while it is'nt in C).
I ran into this problem after upgrading (from version that came with ubuntu 10.04 (0.9.5)) to the ppa version of unicap.
Changed in libunicap (Fedora): | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
To post a comment you must log in.
Description of problem:
When compiling a C++ program with unicap.h, the following error occurs:
/usr/include/ unicap/ unicap. h:218:34: error: expected unqualified-id before ‘private’ unicap/ unicap. h:218:34: error: expected ‘;’ before ‘private’
/usr/include/
Upon further inspection, line 218 of unicap.h contains the following: data_buffer_ private_ t *private;
unicap_
The "private" C++ keyword is being used here as a member name inside of a struct, which is preventing g++ from using unicap.h
Version-Release number of selected component (if applicable): 0.9.12- 1.fc14. x86_64 devel-0. 9.12-1. fc14.x86_ 64
libunicap-
libunicap-
How reproducible:
Compile a C++ program with unicap.h included.
Steps to Reproduce:
1. Create file "unicaptest.cpp" with trivial program:
#include "unicap.h"
int main(){}
2. Run g++ `pkg-config --cflags libunicap` -o unicaptest unicaptest.cpp
3. View error.
Actual results:
Program fails to compile, with above error
Expected results:
Program compiles
Additional info:
Test case compiles when the file extension is changed to .c and gcc is used.