all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Engster <deng@randomsample.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: chengang31@gmail.com, emacs-devel@gnu.org
Subject: Re: Using stpcpy
Date: Sat, 27 Dec 2014 21:49:50 +0100	[thread overview]
Message-ID: <874msgvmvl.fsf@engster.org> (raw)
In-Reply-To: <838uhslu0q.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 27 Dec 2014 22:25:41 +0200")

Eli Zaretskii writes:
>> Date: Sat, 27 Dec 2014 22:17:45 +0200
>> From: Eli Zaretskii <eliz@gnu.org>
>> Cc: chengang31@gmail.com, emacs-devel@gnu.org
>> 
>> > 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	other threads:[~2014-12-27 20:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-22 16:41 Using stpcpy Dmitry Antipov
2014-12-23  6:47 ` Paul Eggert
2014-12-23 10:39   ` Dmitry Antipov
2014-12-25 12:25     ` Paul Eggert
2014-12-25 17:42       ` Dmitry Antipov
2014-12-25 23:44         ` Paul Eggert
2014-12-26 17:06           ` Dani Moncayo
2014-12-26 21:24             ` Eli Zaretskii
2014-12-26 22:01               ` Dani Moncayo
2014-12-27  5:56                 ` cg
2014-12-27  7:45                   ` Eli Zaretskii
2014-12-27 10:26                     ` Dani Moncayo
2014-12-27 10:39                       ` Eli Zaretskii
2014-12-27 10:54                         ` Dani Moncayo
2014-12-27 11:57                     ` cg
2014-12-27 19:52                       ` Eli Zaretskii
2014-12-27 20:03                         ` David Engster
2014-12-27 20:17                           ` Eli Zaretskii
2014-12-27 20:25                             ` Eli Zaretskii
2014-12-27 20:49                               ` David Engster [this message]
2014-12-28  3:36                                 ` Eli Zaretskii
2014-12-28 23:57                               ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874msgvmvl.fsf@engster.org \
    --to=deng@randomsample.de \
    --cc=chengang31@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.