linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Derek M Jones <derek@knosof.co.uk>
Cc: akpm@linux-foundation.org, Josh Triplett <josh@freedesktop.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-sparse@vger.kernel.org, adobriyan@sw.ru, ak@suse.de
Subject: Re: [patch 5/9] x86_64: arch_pick_mmap_layout() fixlet
Date: Fri, 6 Jul 2007 11:48:31 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.0.999.0707061145440.8278@woody.linux-foundation.org> (raw)
In-Reply-To: <468E8C84.1020508@knosof.co.uk>



On Fri, 6 Jul 2007, Derek M Jones wrote:
> 
> > Returning a void-valued expression in a void-valued function is proper C99
> > (and gcc has allowed it for longer). And it often makes for 
> 
> No such change was made in C99.
> Sentence 1785 http://c0x.coding-guidelines.com/6.8.6.4.html

Oops. Ok, my bad. It's apparently just a long-time gcc feature.

It's one that I was initially surprised by, but it's certainly a sensible 
one from a type standpoint, and a lot better thought out than some gcc 
extensions ;)

So I do actually like it. It's much nicer exactly for code like

	if (somecase)
		return that_case_handler();

where the type of the function to handle the case matches the type of the 
calling function (regardless of whether that type is void or not, but 
void obviously is a special case).

		Linus

  reply	other threads:[~2007-07-06 18:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200707060939.l669drk2019988@imap1.linux-foundation.org>
2007-07-06 17:21 ` [patch 5/9] x86_64: arch_pick_mmap_layout() fixlet Linus Torvalds
2007-07-06 18:40   ` Derek M Jones
2007-07-06 18:48     ` Linus Torvalds [this message]
2007-07-06 19:53   ` Josh Triplett
2007-07-06 21:39     ` Pavel Roskin

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=alpine.LFD.0.999.0707061145440.8278@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=adobriyan@sw.ru \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=derek@knosof.co.uk \
    --cc=josh@freedesktop.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 NNTP newsgroup(s).