Bug 80205 - rpm-4.2 rpmds "this" keyword breaks C++
Summary: rpm-4.2 rpmds "this" keyword breaks C++
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: rpm
Version: 1.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-22 09:27 UTC by Warren Togami
Modified: 2007-04-18 16:49 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-12-31 00:24:58 UTC
Embargoed:


Attachments (Terms of Use)

Description Warren Togami 2002-12-22 09:27:29 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021218

Description of problem:
/usr/include/rpm/rpmds.h line 276:
int rpmdsFind(rpmds ds, /*@null@*/ rpmds this)
/usr/include/rpm/rpmds.h line 286
int rpmdsMerge(/*@out@*/ rpmds * dsp, /*@null@*/ rpmds this)

Within these prototypes the identifier "this" is a valid argument name in C, but
a reserved keyword in C++, thus if a C++ program includes the rpmds.h header it
will fail to compile.

I think a simple fix would be to change "this" variable name to any other valid
non-keyword.

For example, apt for rpm written in C++ fails with this error:
Compiling rpm/rpmlistparser.cc to /usr/src/redhat/BUILD/apt-0.5.4cnc9/obj/apt-pk
g/rpmlistparser.opic
In file included from rpm/rpmlistparser.cc:33:
/usr/include/rpm/rpmds.h:276: parse error before `this'
/usr/include/rpm/rpmds.h:286: parse error before `this'

Version-Release number of selected component (if applicable):
Rawhide rpm-4.2.0-0.25.1
Rawhide gcc-3.2.1-2
Freshrpms apt-0.5.4cnc9

Comment 1 Jeff Johnson 2002-12-23 21:26:31 UTC
Will be fixed soonish.

Comment 2 Warren Togami 2002-12-31 00:24:58 UTC
Oops, wrong report.



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