From: "Robert P. J. Day" <rpjday@mindspring.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH] MIPS: Transform old-style macros to newer "__noreturn" standard.
Date: Fri, 25 May 2007 15:04:18 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0705251458440.13906@localhost.localdomain> (raw)
In-Reply-To: <46572DAF.1000108@zytor.com>
On Fri, 25 May 2007, H. Peter Anvin wrote:
> Robert P. J. Day wrote:
> > Convert old/obsolete NORET_TYPE and ATTRIB_NORET macros to use the
> > newer standard of "__noreturn" as defined in compiler-gcc.h.
> >
> > Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
>
> > 1) in a function declaration, the "__noreturn" will go at the end of
> > the declaration.
> >
> > 2) in a definition, "__noreturn" will go between the return type and
> > the function name
> >
> > 3) in a function typedef, "__noreturn" will go immediately after the
> > return type, just like with definitions.
> >
> > 4) if a function definition already includes "__noreturn", there's no
> > point in having any external references to it also say the same thing.
> > (right?)
>
> This is dumb, though.
>
> "void __noreturn" is redundant. It would be much cleaner to have a
> macro which amounts to "void __attribute__((noreturn))" and use it
> instead of giving a return type.
>
> Even "void" as the return type is bogus -- the function never
> returns so it doesn't *have* a return type...
i agree, and i just did a quick test and noticed that, if you try to
declare a function thusly:
f() __attribute__((noreturn)) ;
you get:
warning: data definition has no type or storage class
but gcc doesn't complain if you declare it thusly:
__attribute__((noreturn)) f() ;
that strikes me as a flaw in gcc, no?
rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA
http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================
next prev parent reply other threads:[~2007-05-25 19:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-25 18:32 Robert P. J. Day
2007-05-25 18:40 ` H. Peter Anvin
2007-05-25 19:04 ` Robert P. J. Day [this message]
2007-05-25 19:38 ` H. Peter Anvin
2007-05-25 21:10 ` Robert P. J. Day
2007-05-25 21:43 ` H. Peter Anvin
2007-05-25 22:16 ` Satyam Sharma
2007-05-25 22:25 ` H. Peter Anvin
2007-05-25 22:35 ` Satyam Sharma
2007-05-25 22:46 ` H. Peter Anvin
2007-05-25 22:56 ` Satyam Sharma
2007-05-26 13:33 ` Robert P. J. Day
2007-05-26 18:10 ` H. Peter Anvin
2007-05-26 23:29 ` H. Peter Anvin
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=Pine.LNX.4.64.0705251458440.13906@localhost.localdomain \
--to=rpjday@mindspring.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ralf@linux-mips.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®