emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using stpcpy


From: David Engster
Subject: Re: Using stpcpy
Date: Sat, 27 Dec 2014 21:49:50 +0100
User-agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3.91 (gnu/linux)

Eli Zaretskii writes:
>> Date: Sat, 27 Dec 2014 22:17:45 +0200
>> From: Eli Zaretskii <address@hidden>
>> Cc: address@hidden, address@hidden
>> 
>> > Yes, it seems gcc optimizes this because of the following strlen
>> > call. You can disable this optimization with -fno-optimize-strlen.
>> 
>> GCC shouldn't have done that by default.  It's nasty.
>
> To say nothing of the fact that this switch is not documented in the
> GCC manual, not even in the manual that comes with GCC 4.8.

It was documented in the GCC 4.7 release notes

https://gcc.gnu.org/gcc-4.7/changes.html

but was apparently forgotten for the regular docs. It's not even in
4.9.2, but it seems they just fixed it, since at least -foptimize-strlen
is now documented:

https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Optimize-Options

However, the above release notes also say that it will only switch
functions "for hosted compilations where stpcpy is available in the
runtime and headers provide its prototype", so the prototype alone
should not be enough. Why does GCC think that your runtime provides
stpcpy when it does not?

-David



reply via email to

[Prev in Thread] Current Thread [Next in Thread]