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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 15 Aug 2014 21:30:43 +0200
From:	Jakub Jelinek <jakub@...hat.com>
To:	Paul Gortmaker <paul.gortmaker@...driver.com>
Cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
	Richard Henderson <rth@...ddle.net>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH] gcc version 5: add basic definition header for latest
 gcc version

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
--
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