[Bug go/90110] [9 Regression] libgo fails to build against glibc 2.19

ian at airs dot com gcc-bugzilla@gcc.gnu.org
Wed Apr 17 14:13:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90110

--- Comment #7 from Ian Lance Taylor <ian at airs dot com> ---
> What is the condition i > 0x7fffffff for?  Shouldn't that test val instead?

Yes, it certainly should.  Thanks.  It's not the problem here, but should be
fixed.

> Just a wild guess - does this->body_.substr(start, i - start).c_str() 
really live until after strtol has completed?

I *think* it should be OK.  The rule in C++ is that temporary objects are
destroyed after the full expression that lexically contains the point at which
they are created has been evaluated.  In this case the full expression is the
call to strtol, so the temporary object created by the call to substr should
live until the call to strtol is complete.


More information about the Gcc-bugs mailing list