login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for #48 #define unlikely defined in linux/compiler.h revision 1 of 1

1
Editor:
Time: 2007/11/17 22:57:59 GMT-8
Note: property change

changed:
-
I finally nailed its origin down to /usr/include/linux/compiler.h
In that file, we have

=====
/* Somewhere in the middle of the GCC 2.96 development cycle, we implemented
   a mechanism by which the user can annotate likely branch directions and
   expect the blocks to be reordered appropriately.  Define __builtin_expect
   to nothing for earlier compilers.  */

#if __GNUC__ == 2 && __GNUC_MINOR__ < 96
#define __builtin_expect(x, expected_value) (x)
#endif

#define likely(x)       __builtin_expect((x),1)
#define unlikely(x)     __builtin_expect((x),0)
=====
  

Notice that those defines are not guarded by __KERNEL__.

I would suggest that, Axiom spells its C MACROS all in CAPS, and
prefix them with AXIOM_.
Is that workable?

From unknown Mon Jan 24 18:42:59 -0600 2005
From: 
Date: Mon, 24 Jan 2005 18:42:59 -0600
Subject: property change
Message-ID: <20050124184259-0600@page.axiom-developer.org>

Category: Axiom Compiler => building Axiom from source 


Submitted by : (unknown) at: 2007-11-17T22:57:59-08:00 (17 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

I finally nailed its origin down to /usr/include/linux/compiler.h
In that file, we have

=====
/* Somewhere in the middle of the GCC 2.96 development cycle, we implemented
   a mechanism by which the user can annotate likely branch directions and
   expect the blocks to be reordered appropriately.  Define __builtin_expect
   to nothing for earlier compilers.  */

#if __GNUC__ == 2 && __GNUC_MINOR__ < 96
#define __builtin_expect(x, expected_value) (x)
#endif

#define likely(x)       __builtin_expect((x),1)
#define unlikely(x)     __builtin_expect((x),0)
=====
  

Notice that those defines are not guarded by __KERNEL__.

I would suggest that, Axiom spells its C MACROS all in CAPS, and
prefix them with AXIOM_.
Is that workable?

------------------------------------------------------------


property change --Mon, 24 Jan 2005 18:42:59 -0600

Category: Axiom Compiler => building Axiom from source