c++ keyword "private" in unicap.h

Bug #658739 reported by dogguts on 2010-10-11
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unicap
Medium
Arne Caspari
libunicap (Fedora)
Fix Released
Medium

Bug Description

revision 65 of unicap.h introduced "private" in the "_unicap_data_buffer_t" structure.
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.

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’
/usr/include/unicap/unicap.h:218:34: error: expected ‘;’ before ‘private’

Upon further inspection, line 218 of unicap.h contains the following:
   unicap_data_buffer_private_t *private;

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):
libunicap-0.9.12-1.fc14.x86_64
libunicap-devel-0.9.12-1.fc14.x86_64

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.

Thank you for filing the bug. It seems to be already reported upstream, although on a completely wrong place:

https://bugs.launchpad.net/unicap/+bug/656229/comments/3

fixed in libunicap-0.9.12-4.fc15

libunicap-0.9.12-2.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/libunicap-0.9.12-2.fc14

libunicap-0.9.12-2.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/libunicap-0.9.12-2.fc13

libunicap-0.9.12-2.fc14 has been pushed to the Fedora 14 testing repository. If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with
 su -c 'yum --enablerepo=updates-testing update libunicap'. You can provide feedback for this update here: https://admin.fedoraproject.org/updates/libunicap-0.9.12-2.fc14

libunicap-0.9.12-2.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.

libunicap-0.9.12-2.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.

libunicap-0.9.12-5.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/libunicap-0.9.12-5.fc12

libunicap-0.9.12-5.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/libunicap-0.9.12-5.el5

libunicap-0.9.12-6.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/libunicap-0.9.12-6.fc12

libunicap-0.9.12-7.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/libunicap-0.9.12-7.el5

libunicap-0.9.12-6.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.

Arne Caspari (arne-datafloater) wrote :

Fixed in BZR repository now. I will build new packages soon.

Changed in unicap:
status: New → Fix Committed
importance: Undecided → Medium
assignee: nobody → Arne Caspari (arne-datafloater)

libunicap-0.9.12-7.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report.

Changed in libunicap (Fedora):
importance: Unknown → Medium
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.