mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Richard Henderson <rth@twiddle.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] gcc version 5: add basic definition header for latest gcc version
Date: Fri, 15 Aug 2014 21:30:43 +0200	[thread overview]
Message-ID: <20140815193043.GU1784@tucnak.redhat.com> (raw)
In-Reply-To: <1408130581-4806-1-git-send-email-paul.gortmaker@windriver.com>

On Fri, Aug 15, 2014 at 03:23:01PM -0400, Paul Gortmaker wrote:
> --- /dev/null
> +++ b/include/linux/compiler-gcc5.h
> @@ -0,0 +1,52 @@
> +#ifndef __LINUX_COMPILER_H
> +#error "Please don't include <linux/compiler-gcc5.h> directly, include <linux/compiler.h> instead."
> +#endif
> +
> +#define __used			__attribute__((__used__))
> +#define __must_check		__attribute__((warn_unused_result))
> +#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
> +
> +/* Mark functions as cold. gcc will assume any path leading to a call
> +   to them will be unlikely.  This means a lot of manual unlikely()s
> +   are unnecessary now for any paths leading to the usual suspects
> +   like BUG(), printk(), panic() etc. [but let's keep them for now for
> +   older compilers]
> +
> +   Early snapshots of gcc 4.3 don't support this and we can't detect this
> +   in the preprocessor, but we can live with this because they're unreleased.
> +   Maketime probing would be overkill here.

The above 4 lines are probably unnecessary.

More importantly, is it a good idea to store the gcc major number in the
header?  gcc 5.x will be released next year, but the year after that we'll
have gcc 6.x, so you'd need to copy this header each year.

	Jakub

      reply	other threads:[~2014-08-15 19:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-15 19:23 Paul Gortmaker
2014-08-15 19:30 ` Jakub Jelinek [this message]

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=20140815193043.GU1784@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=rth@twiddle.net \
    --cc=torvalds@linux-foundation.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®