lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 26 May 2007 03:46:48 +0530
From:	"Satyam Sharma" <satyam.sharma@...il.com>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	"Robert P. J. Day" <rpjday@...dspring.com>,
	"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
	"Ralf Baechle" <ralf@...ux-mips.org>
Subject: Re: [PATCH] MIPS: Transform old-style macros to newer "__noreturn" standard.

Hi Peter,

On 5/26/07, H. Peter Anvin <hpa@...or.com> wrote:
> Robert P. J. Day wrote:
> >> ... and declare functions as:
> >>
> >> __noreturn f();
> >>
> >> ... which is the syntactially sane way of doing it.
> >
> > that may be, but keep in mind that gcc allows attributes to *follow*
> > the parameter list as well, and some people might prefer to do the
> > following:
> >
> >   f() __noreturn;
> >
> > that would fail badly if you defined __noreturn as you suggest.
>
> That's equally moronic that saying that "some people might prefer to
> write 'f() void;'", which is what it's *EXACTLY* equivalent to.  Yes,
> they might "prefer" it, but it's syntactically invalid and the compiler
> won't accept it.  As it shouldn't.
>
> __noreturn here takes the syntactic place of the return type, because
> that's what it IS.

But __attribute__((noreturn)) is simply a _function attribute_. Of course,
it is legal / valid only for functions with return-type void, so it does make
sense to combine both void and __attribute__((noreturn)) in the same
macro like you say. But that's not syntactically necessary. In fact,
grepping through the sources, a lot of people do prefer to place the
attribute _after_ the function declarator.

Anyway, I'm fine either way.

Thanks,
Satyam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ