From: Martin Sebor <msebor@redhat.com>
To: Sandra Loosemore <sandra@codesourcery.com>
Cc: Gcc Patch List <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] clarify doc for __builtin_return_address
Date: Thu, 21 May 2015 21:22:00 -0000 [thread overview]
Message-ID: <555E43BE.30206@redhat.com> (raw)
In-Reply-To: <555E3A88.3060009@codesourcery.com>
On 05/21/2015 02:05 PM, Sandra Loosemore wrote:
> On 05/21/2015 01:19 PM, Martin Sebor wrote:
>
>> 2015-05-21 Martin Sebor <msebor@redhat.com>
>>
>> * extend.texi (Return Address): Clarify possible effects
>> of calling the functions with non-zero arguments.
>>
>> diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
>> index 7470e40..b37e893 100644
>> --- a/gcc/doc/extend.texi
>> +++ b/gcc/doc/extend.texi
>> @@ -7959,7 +7959,8 @@ Additional post-processing of the returned value
>> may be needed, see
>> @code{__builtin_extract_return_addr}.
>>
>> This function should only be used with a nonzero argument for debugging
>> -purposes.
>> +purposes since such calls to it can have unpredictable effects,
>> including
>> +crashing the calling program.
>> @end deftypefn
>>
>> @deftypefn {Built-in Function} {void *} __builtin_extract_return_addr
>> (void *@var{addr})
>
> I think the problem is that the original sentence parses ambiguously --
> is it telling you that you must pass a nonzero argument to use it for
> debugging purposes, or telling you that you must use calls with a
> nonzero argument only for debugging? And adding an additional clause
> onto the end only makes it harder to parse.
>
> I suggest rewriting it as something like
>
> Calling this function with a nonzero argument can have unpredictable
> effects, including crashing the calling program. Such calls are
> typically only useful in debugging situations.
Thanks. I agree that's better. I'll wait for further comments
or approval to commit your version.
Martin
next prev parent reply other threads:[~2015-05-21 20:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-21 19:37 Martin Sebor
2015-05-21 20:50 ` Sandra Loosemore
2015-05-21 21:22 ` Martin Sebor [this message]
2015-05-21 22:00 ` Pedro Alves
2015-06-11 23:22 ` [PATCH] warn for unsafe calls to __builtin_return_address Martin Sebor
2015-06-18 17:32 ` [PING] " Martin Sebor
2015-06-27 0:48 ` [PING 2] " Martin Sebor
2015-07-07 3:41 ` [PING 3] " Martin Sebor
2015-07-07 10:14 ` Pedro Alves
2015-07-24 5:30 ` Jeff Law
2015-07-25 15:59 ` Segher Boessenkool
2015-07-28 3:44 ` Martin Sebor
2015-07-28 15:19 ` Segher Boessenkool
2015-07-28 16:03 ` Martin Sebor
2015-07-31 16:46 ` Jeff Law
2015-08-02 23:15 ` Martin Sebor
2015-08-03 11:55 ` [BUILDROBOT] Go runtime: calling ‘__builtin_frame_address’ with a nonzero argument is unsafe (was: warn for unsafe calls to __builtin_return_address) Jan-Benedict Glaw
2015-08-03 14:48 ` [BUILDROBOT] Go runtime: calling ‘__builtin_frame_address’ with a nonzero argument is unsafe Martin Sebor
2015-08-03 15:29 ` Jeff Law
2015-08-05 7:28 ` [PATCH] warn for unsafe calls to __builtin_return_address Andreas Schwab
2015-08-05 16:03 ` Jiong Wang
2015-08-05 17:56 ` Martin Sebor
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=555E43BE.30206@redhat.com \
--to=msebor@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=sandra@codesourcery.com \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).