This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 2/3] Add missing ATTRIBUTE_NORETURNs
- From: Tom Tromey <tom at tromey dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: Tom Tromey <tom at tromey dot com>, "gdb-patches\@sourceware.org" <gdb-patches at sourceware dot org>
- Date: Wed, 28 Sep 2016 09:20:54 -0600
- Subject: Re: [RFA 2/3] Add missing ATTRIBUTE_NORETURNs
- Authentication-results: sourceware.org; auth=none
- References: <1475000192-8789-1-git-send-email-tom@tromey.com> <1475000192-8789-3-git-send-email-tom@tromey.com> <CAH=s-PPVBmAv2RXyrZjotXZHOTSZ4gRb=nucU-qfZ+hQMfRt9g@mail.gmail.com>
>>>>> "Yao" == Yao Qi <qiyaoltc@gmail.com> writes:
>> -extern void throw_max_completions_reached_error (void);
>> +extern void throw_max_completions_reached_error (void)
>> + ATTRIBUTE_NORETURN;
Yao> Don't we need to also add ATTRIBUTE_NORETURN to the definition of
Yao> throw_max_completions_reached_error?
No, it's sufficient to have an attribute on a prototype, if the
prototype is in scope when the definition is seen. This seems to be the
normal approach in gdb, e.g., see error_no_arg.
Tom