From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11838 invoked by alias); 27 Mar 2008 19:46:43 -0000 Received: (qmail 11825 invoked by uid 22791); 27 Mar 2008 19:46:43 -0000 X-Spam-Check-By: sourceware.org Received: from pasmtpa.tele.dk (HELO pasmtpA.tele.dk) (80.160.77.114) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 27 Mar 2008 19:46:16 +0000 Received: from ravnborg.org (0x535d98d8.vgnxx8.adsl-dhcp.tele.dk [83.93.152.216]) by pasmtpA.tele.dk (Postfix) with ESMTP id 8C8E780068A; Thu, 27 Mar 2008 20:46:14 +0100 (CET) Received: by ravnborg.org (Postfix, from userid 500) id 2CAEA580DA; Thu, 27 Mar 2008 20:46:39 +0100 (CET) Date: Thu, 27 Mar 2008 19:46:00 -0000 From: Sam Ravnborg To: Ian Lance Taylor Cc: eus@member.fsf.org, gcc-help@gcc.gnu.org Subject: Re: Does GCC really recognize __attribute__ ((bitwise))? Message-ID: <20080327194639.GA2264@uranus.ravnborg.org> References: <665888.73509.qm@web37613.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg00267.txt.bz2 On Thu, Mar 27, 2008 at 10:39:22AM -0700, Ian Lance Taylor wrote: > 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