maximilian attems
2006-Jun-20 11:49 UTC
[klibc] [patch] compiler.h fix use of likely/unlikely
patch from Hannes Reinecke <hare at suse.de> reduces noise on s390 build logs. while we are it remove check for early 2.X gcc versions. Signed-off-by: maximilian attems <maks at sternwelten.at> diff --git a/usr/include/klibc/compiler.h b/usr/include/klibc/compiler.h index 893f8a9..b7d9b50 100644 --- a/usr/include/klibc/compiler.h +++ b/usr/include/klibc/compiler.h @@ -91,12 +91,12 @@ # define __mallocfunc #endif /* likely/unlikely */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) -# define __likely(x) __builtin_expect((x), 1) -# define __unlikely(x) __builtin_expect((x), 0) +#if defined(__GNUC__) +# define likely(x) __builtin_expect((x), 1) +# define unlikely(x) __builtin_expect((x), 0) #else -# define __likely(x) (x) -# define __unlikely(x) (x) +# define likely(x) (x) +# define unlikely(x) (x) #endif /* Possibly unused function */
H. Peter Anvin
2006-Jun-20 21:38 UTC
[klibc] [patch] compiler.h fix use of likely/unlikely
maximilian attems wrote:> patch from Hannes Reinecke <hare at suse.de> reduces noise > on s390 build logs. > while we are it remove check for early 2.X gcc versions. > > Signed-off-by: maximilian attems <maks at sternwelten.at> > > diff --git a/usr/include/klibc/compiler.h b/usr/include/klibc/compiler.h > index 893f8a9..b7d9b50 100644 > --- a/usr/include/klibc/compiler.h > +++ b/usr/include/klibc/compiler.h > @@ -91,12 +91,12 @@ # define __mallocfunc > #endif > > /* likely/unlikely */ > -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) > -# define __likely(x) __builtin_expect((x), 1) > -# define __unlikely(x) __builtin_expect((x), 0) > +#if defined(__GNUC__) > +# define likely(x) __builtin_expect((x), 1) > +# define unlikely(x) __builtin_expect((x), 0) > #else > -# define __likely(x) (x) > -# define __unlikely(x) (x) > +# define likely(x) (x) > +# define unlikely(x) (x) > #endif >NAK. This patch is wrong. likely() and unlikely() don't belong in userspace without the underscores, for namespace reasons. -hpa
Seemingly Similar Threads
- Bug#344832: (fwd) Re: Bug#344832: correct subject header
- [patch] fix defintion of struct statfs64
- [patch] Kbuild.klibc don't hardcode gcc version
- [patch] statfs64 sparc64 fix
- [PATCH nbdkit] server: Use GCC hints to move debug and error handling code out of hot paths.