Compiling with gcc-4.0.0 and -fno-exceptions
Dan Kegel
dank@kegel.com
Tue Jun 7 16:33:00 GMT 2005
Paolo Carlini wrote:
>> I would suggest trying to figure
>>which is the current situation in Bugzilla, 4.0.1 pre, and mainline (I
>>can also do that, of course, but would appreciate a stand-alone snippet
>
>>from your work) and then take the appropriate action.
>
> The issue seems fixed in mainline (I'm using simple testcases like a
> single uninitialized_copy on a vector of non-PODs, -fno-exceptions -O
> -Wreturn-type). However, seems still present in 4_0-branch,
> unfortunately. I would suggest making sure that there are no duplicate
> PRs and, in case, file one, the safe way: it can even be that in
> mainline it's fixed by chance ;)
Here's one example of the problem in question:
#include <vector>
std::vector<int> *factory()
{
std::vector<int> *p = new std::vector<int>;
p->reserve(10);
return p;
}
$ i686-unknown-linux-gnu-g++ foo.cc -Wall -O -fno-exceptions
.../include/c++/4.0.0/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::reserve(size_t) [with _Tp = int, _Alloc = std::allocator<int>]':
.../include/c++/4.0.0/bits/vector.tcc:78: warning: control may reach end of non-void function 'typename _Alloc::pointer std::vector<_Tp, _Alloc>::_M_allocate_and_copy(size_t, _ForwardIterator, _ForwardIterator) [with _ForwardIterator =
int*, _Tp = int, _Alloc = std::allocator<int>]' being inlined
And as you said, the same error does not occur with
a recent snapshot of gcc-4.1.
I'll file the bug against gcc-4.0 as you suggested
after a bugzilla search.
Thanks!
- Dan
--
Trying to get a job as a c++ developer? See http://kegel.com/academy/getting-hired.html
More information about the Libstdc++
mailing list