Bug 474651

Summary: Cannot combine std::vector begin() with insert()
Product: [Fedora] Fedora Reporter: Ben Webb <ben>
Component: swigAssignee: Adam Tkac <atkac>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 10CC: atkac, ovasik
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-18 07:09:41 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:
Attachments:
Description Flags
Makefile
none
test.i
none
swig-iterators.patch none

Description Ben Webb 2008-12-04 19:04:10 UTC
Created attachment 325720 [details]
Makefile

Description of problem:
In SWIG 1.3.35 any code that requires non-const STL container iterators, which worked with SWIG 1.3.33 in Fedora 9, fails, since non-const iterators are no longer provided. For example, std::vector's insert() can no longer be fed the output of the begin() method, since insert requires a non-const iterator and begin() now can only return a const one.


Version-Release number of selected component (if applicable):
swig-1.3.35-2.fc10.x86_64

How reproducible:
Always.


Steps to Reproduce:
1. Download the attached test.i and Makefile into the same directory.
2. Install SWIG, python and g++.
3. Type 'make'.
  
Actual results:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "test.py", line 117, in insert
    def insert(*args): return _test.vectorf_insert(*args)
NotImplementedError: Wrong number of arguments for overloaded function 'vectorf_insert'.
  Possible C/C++ prototypes are:
    insert(std::vector< float > *,std::vector< float >::iterator,std::vector< float >::value_type const &)
    insert(std::vector< float > *,std::vector< float >::iterator,std::vector< float >::size_type,std::vector< float >::value_type const &)

make: *** [test] Error 1


Expected results:
The call to insert() succeeds with no output.

Additional info:

Comment 1 Ben Webb 2008-12-04 19:04:40 UTC
Created attachment 325721 [details]
test.i

Comment 2 Ben Webb 2008-12-04 19:07:05 UTC
As I was also able to reproduce this problem with upstream sources, I have also reported it there:
https://sourceforge.net/tracker/index.php?func=detail&aid=2380788&group_id=1645&atid=101645

It appears that SWIG 1.3.35 removed non-const iterators in order to quell some compiler warnings. However, since this results in code that will not run, it seems to me that the original warnings were better. I will attach a short patch that fixes this problem for me.

Comment 3 Ben Webb 2008-12-04 19:08:17 UTC
Created attachment 325722 [details]
swig-iterators.patch

This proposed fix backs out SWIG SVN r10322 and restores non-const iterators. This fixes the problem for me.

Comment 4 Adam Tkac 2008-12-08 11:18:52 UTC
(In reply to comment #3)
> 
> This proposed fix backs out SWIG SVN r10322 and restores non-const iterators.
> This fixes the problem for me.

I can build temporary rpm for you with your patch if you are interested but I'm not going to release update till upstream fix this problem.

Comment 5 Ben Webb 2008-12-08 17:32:19 UTC
That's OK - I can build my own RPM to work around the problem. I'll take it up with upstream. They want to fix the problem "properly" which is of course commendable but makes the public stable releases useless for us in the meantime.

Comment 6 Bug Zapper 2009-11-18 09:38:13 UTC
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Bug Zapper 2009-12-18 07:09:41 UTC
Fedora 10 changed to end-of-life (EOL) status on 2009-12-17. Fedora 10 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.