Merge lp:~cwilson/spud/pointers_to_incomplete_type into lp:spud
Status: | Merged |
---|---|
Merged at revision: | 537 |
Proposed branch: | lp:~cwilson/spud/pointers_to_incomplete_type |
Merge into: | lp:spud |
Diff against target: |
335 lines (+73/-68) 2 files modified
include/spud (+7/-7) src/spud.cpp (+66/-61) |
To merge this branch: | bzr merge lp:~cwilson/spud/pointers_to_incomplete_type |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stephan Kramer | Approve | ||
Review via email: mp+267956@code.launchpad.net |
Description of the change
I've been trying to compile spud using clang on mac OSX 10.10 (Yosemite) and ran into a few problems. This branch fixes them...
1. The Option class depends on storing a std::deque of std::pairs of std::strings and Options. This involves instantiating a deque using an incomplete type (as you're passing an Option type to the pair and deque from within the definition of the Option type). The behaviour of this is apparently undefined - the stdlib implementation we've been using on ubuntu has been able to deal with it but the llvm/clang/mac implementation complains:
"error: field has incomplete type 'Spud::
To deal with this I've changed the deque to store pairs of strings and pointers to Options. I've therefore also changed the destructors to delete these pointers.
2. spud.cpp was segfaulting at line 1456 (in the new branch). This was because child had been left pointing to children.end(), a new child had then been pushed back onto children and it was assumed that child (pointing to children.end()) would now point at the new entry in children, which appears not to be true with this stdlib implementation. A small fix just updates child to point at the new final entry in the children deque.
I've manually merged these changes into fluidity:
https:/
(note that I've only merged these changes on top of what appears to be an out of date spud in fluidity). This passes make test locally and is being run through the buildbot here:
http://
Green (fluidity) buildbot.