View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000592 | ascend | build-linux | public | 2016-04-16 03:32 | 2017-09-03 21:53 |
Reporter | sagitter | ||||
Assigned To | john | ||||
Priority | high | Severity | block | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | Linux | OS | Fedora | OS Version | 24+ |
Product Version | 0.9.8 | ||||
Target Version | Fixed in Version | 0.9.9 | |||
Summary | 0000592: 'Curve default constructor' and GCC6 | ||||
Description | Issue discussed and resolved in the Fedora devel mailing list: In C++98 constructing std::vector<X> v(1); would invoke X's default constructor in the caller's context, so if the default constructor is private then the caller must be a member or friend of X. In C++11 the default constructor will be invoked deep inside std::vector, or one of its helper functions. The code is basically invalid in C++11. It should either make the default constructor public (the simplest fix), or change how the vector is constructed (which seems to come from Swig, so might be difficult). > gcc -o tcltk/interface/AscBitmaps.os -c -fvisibility=hidden ""-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -Wl,-z,relro -pie -Wl,-z,now"" -fPIC -DHAVE_GCCVISIBILITY -I. -I/usr/include/tcl8.6 -I/usr/include/tcl8.6 tcltk/interface/AscBitmaps.c In file included from /usr/include/c++/6.0.0/vector:62:0, from ascxx/ascpy_wrap.cc:3038: /usr/include/c++/6.0.0/bits/stl_construct.h: In instantiation of 'void std::_Construct(_T1*, _Args&& ...) [with _T1 = Curve; _Args = {}]': /usr/include/c++/6.0.0/bits/stl_uninitialized.h:519:18: required from 'static _ForwardIterator std::__uninitialized_default_n_1<_TrivialValueType>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = Curve*; _Size = unsigned int; bool _TrivialValueType = false]' /usr/include/c++/6.0.0/bits/stl_uninitialized.h:575:20: required from '_ForwardIterator std::__uninitialized_default_n(_ForwardIterator, _Size) [with _ForwardIterator = Curve*; _Size = unsigned int]' /usr/include/c++/6.0.0/bits/stl_uninitialized.h:637:44: required from '_ForwardIterator std::__uninitialized_default_n_a(_ForwardIterator, _Size, std::allocator<_Tp>&) [with _ForwardIterator = Curve*; _Size = unsigned int; _Tp = Curve]' /usr/include/c++/6.0.0/bits/stl_vector.h:1309:36: required from 'void std::vector<_Tp, _Alloc>::_M_default_initialize(std::vector<_Tp, _Alloc>::size_type) [with _Tp = Curve; _Alloc = std::allocator<Curve>; std::vector<_Tp, _Alloc>::size_type = unsigned int]' /usr/include/c++/6.0.0/bits/stl_vector.h:281:30: required from 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = Curve; _Alloc = std::allocator<Curve>; std::vector<_Tp, _Alloc>::size_type = unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<Curve>]' ascxx/ascpy_wrap.cc:27027:69: required from here /usr/include/c++/6.0.0/bits/stl_construct.h:75:7: error: 'Curve::Curve()' is private within this context { ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); } ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ascxx/plot.h:10:0, from ascxx/ascpy_wrap.cc:4058: ascxx/curve.h:15:2: note: declared private here Curve(); ^~~~~ solvers/qrslv/qrslv.c: In function 'qrslv_get_default_parameters': solvers/qrslv/qrslv.c:2806:9: warning: variable 'make_macros' set but not used [-Wunused-but-set-variable] int32 make_macros = 0; ^~~~~~~~~~~ solvers/qrslv/qrslv.c:2804:18: warning: variable 'lo' set but not used [-Wunused-but-set-variable] union parm_arg lo,hi,val; ^~ solvers/qrslv/qrslv.c:2803:18: warning: variable 'sys' set but not used [-Wunused-but-set-variable] qrslv_system_t sys = NULL; ^~~ | ||||
Steps To Reproduce | Build current Ascend code with GCC-6.0.0 | ||||
Additional Information | Issue resolved by applying attached patch. | ||||
Tags | No tags attached. | ||||
|
ascend-curve.patch (303 bytes)
--- ascxx/curve.orig.h 2015-10-15 20:38:04.000000000 +0200 +++ ascxx/curve.h 2016-04-14 19:15:54.561414901 +0200 @@ -12,8 +12,8 @@ private: friend class Plot; explicit Curve(const Instanc &); - Curve(); public: + Curve(); Curve(const Curve &); std::vector<double> x; std::vector<double> y; |
|
This bug was fixed by changing the SWIG wrapping of this class, instead of the class itself (changeset 3206). I'll get it merged to trunk. |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-04-16 03:32 | sagitter | New Issue | |
2016-04-16 03:32 | sagitter | Status | new => assigned |
2016-04-16 03:32 | sagitter | Assigned To | => john |
2016-04-16 03:32 | sagitter | File Added: ascend-curve.patch | |
2017-09-03 21:52 | john | Note Added: 0001020 | |
2017-09-03 21:53 | john | Status | assigned => resolved |
2017-09-03 21:53 | john | Resolution | open => fixed |
2017-09-03 21:53 | john | Fixed in Version | => 0.9.9 |