Bug 799695

Summary: guestfs.h fails to compile with c++ compiler
Product: Red Hat Enterprise Linux 6 Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3CC: leiwang, mbooth, m.gibula, moli, qguan, qwan, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: libguestfs-1.16.8-1.el6 Doc Type: Bug Fix
Doc Text:
No Documentation needed
Story Points: ---
Clone Of: 799693 Environment:
Last Closed: 2012-06-20 07:00:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 799693    
Bug Blocks:    

Description Richard W.M. Jones 2012-03-04 11:55:58 UTC
+++ This bug was initially created as a clone of Bug #799693 +++

Created attachment 567384 [details]
Proposed patch.

Description of problem:
Function guestfs_mkdtemp uses c++ keyword "template" as a parameter name. In result, attempt to use guestfs.h header in c++ program results in compile error.

Version-Release number of selected component (if applicable):
1.16.7

How reproducible:

#include <guestfs.h>

int main()
{
}


Steps to Reproduce:
1. Try to compile above with g++
  
Actual results:
/usr/include/guestfs.h:1401:76: error: expected ‘,’ or ‘...’ before ‘template’

Expected results:
No error.

Additional info:
Proposed patch included.

--- Additional comment from rjones on 2012-03-04 06:50:55 EST ---

Thanks, the patch looks good and I will push it shortly.

Comment 1 Richard W.M. Jones 2012-03-04 11:59:57 UTC
Upstream commit:
49611f121fa10d1497e46ab9aa6a7448cb89cd86

Comment 3 Mohua Li 2012-03-26 07:23:18 UTC
//guestfs.c

#include <guestfs.h>
int main()
{
}


libguestfs-1.16.5-1.el6(devel package)

[root@dhcp-93-131 tmp]# g++ guestfs.c -o guestfs
In file included from guestfs.c:1:
/usr/include/guestfs.h:1401: error: expected ‘,’ or ‘...’ before ‘template’



libguestfs-1.16.12-1.el6(devel package)

[root@dhcp-93-131 tmp]# g++ guestfs.c -o guestfs

no any error output,

Comment 4 Richard W.M. Jones 2012-04-26 12:22:36 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No Documentation needed

Comment 6 errata-xmlrpc 2012-06-20 07:00:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0774.html