From: Albert Cahalan <albert@users.sf.net>
To: William Lee Irwin III <wli@holomorphy.com>
Cc: linux-kernel mailing list <linux-kernel@vger.kernel.org>,
rth@twiddle.net
Subject: Re: __attribute__((always_inline)) fiasco
Date: 23 Sep 2004 12:59:00 -0400 [thread overview]
Message-ID: <1095958739.4973.948.camel@cube> (raw)
In-Reply-To: <20040923165026.GF9106@holomorphy.com>
On Thu, 2004-09-23 at 12:50, William Lee Irwin III wrote:
> On Thu, Sep 23, 2004 at 12:26:18PM -0400, Albert Cahalan wrote:
> > #define INLINE
> > #define INLINE inline
> > #define INLINE static inline // an oxymoron
> > #define INLINE extern inline // an oxymoron
> > #define INLINE __force_inline
> > #define INLINE __attribute__((always_inline))
> > #define INLINE _Pragma("inline")
> > #define INLINE __inline_or_die_you_foul_compiler
> > #define INLINE _Please inline
>
> The // apart from being a C++ ism (screw C99; it's still non-idiomatic)
Once you get over the initial jolt of seeing new syntax,
you'll find that C99 comments are clearly superior.
Even with block comments above functions, you'll typically
save two lines of screen space. (and 7 bytes)
I think the only trouble is assembly code abusing
the C (note: "C", not "assembly") pre-processor.
> will cause spurious ignorance of the remainder of the line, which is
> often very important. e.g.
>
> static INLINE int lock_need_resched(spinlock_t *lock)
> {
Huh? Sure? It works for me:
albert 0 /tmp$ cat slash.c
#define MAIN main // test C99 comment
int MAIN (int argc, char *argv[]){
(void)argc;
(void)argv;
return 0;
}
albert 0 /tmp$ gcc -Wall -W -O2 slash.c
albert 0 /tmp$ ./a.out
albert 0 /tmp$ gcc -v
Reading specs from /usr/lib/gcc-lib/powerpc-linux/3.2.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc powerpc-linux
Thread model: posix
gcc version 3.2.3 20030415 (Debian prerelease)
next prev parent reply other threads:[~2004-09-23 17:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-23 16:26 __attribute__((always_inline)) fiasco Albert Cahalan
2004-09-23 16:50 ` William Lee Irwin III
2004-09-23 16:59 ` Albert Cahalan [this message]
2004-09-23 17:03 ` Richard Henderson
2004-09-23 17:21 ` viro
2004-09-23 17:33 ` William Lee Irwin III
2004-09-23 17:39 ` viro
2004-09-26 1:29 ` Tonnerre
2004-09-26 2:05 ` William Lee Irwin III
2004-09-30 16:19 ` Bill Davidsen
2004-09-23 16:54 ` Richard Henderson
2004-09-23 17:46 ` Albert Cahalan
-- strict thread matches above, loose matches on Subject: below --
2004-09-23 8:47 Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1095958739.4973.948.camel@cube \
--to=albert@users.sf.net \
--cc=linux-kernel@vger.kernel.org \
--cc=rth@twiddle.net \
--cc=wli@holomorphy.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox