3 msgCan I force gcc not to optimize calling to leaf...
2 msgV_MUST_DEF vs V_MAY_DEF ?
12 msgSignedness of char and puts()
6 msgcompile with no prefix
3 msgnewbie trying to install and build
5 msgambiguous std::fill with character array
4 msgC++ Macros, ##, and ::
3 msgnewbie question on linking classes
2 msgBuild Failure for gcc 4.3.0

Does GCC really recognize __attribute__ ((bitwi...
\ Eus (27 Mar 2008)
. \ Ian Lance Taylor (27 Mar 2008)
. . \ Sam Ravnborg (27 Mar 2008)

2 msgstatic stack check
16 msgProblem with exceptions on arm
1 msgThe Latest
13 msgIssue on X86_64?
1 msgcross compiling on different hosts
2 msgProblem with static library linking
6 msg[help] undefined reference to `_Unwind_SjLj_Reg...
2 msgGSoC - GCC Multithreaded linker
7 msggcc for windows
2 msgHow does GCC4 transform GIMPLE IR to SSA?
Subject:Re: Does GCC really recognize __attribute__ ((bitwise))?
Group:Gcc-help
From:Sam Ravnborg
Date:27 Mar 2008


On Thu, Mar 27, 2008 at 10:39:22AM -0700, Ian Lance Taylor wrote:
> Eus <eus> writes:
>
> > When browsing the Linux kernel 2.6.21.5's source code, I noticed a variable
> > definition like:
> >
> > typedef __u64 __bitwise __be64;
> >
> > Being curious about __bitwise, I found it out to be:
> >
> > #define __bitwise __bitwise__
> >
> > that finally turned out to be:
> >
> > #define __bitwise__ __attribute__((bitwise))
> >
> > Since it was __attribute__, I tried to find its documentation in GCC texinfo
> > file. But, I couldn't find one. Even I have tried to find it out in the Internet.
> > But, I still couldn't find one.
>
> There is no "bitwise" attribute in standard gcc.
>
> Looking at the Linux 2.6.24 sources, I see that it is defined as an
> attribute only when __CHECKER__ is defined. This has something to do
> with sparse--see Documentation/sparse.txt. I don't know the details.

Correct.
We have in the kernel a number of sparse specific extensions.
bitwise, __iomem and __user is the ones most widely used.
sparse uses this to do additional checks that gcc not has context to do.

The __user annotation is used to annotate pointers to data in userspace
which may not be mixed up with pointers in kernel space.

Sam


© 2004-2008 readlist.com