[lkml]   [2001]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: asm/unistd.h
On Thu, 5 Apr 2001, Steve Grubb wrote:

> It would seem to me that after hearing how the macros are used in practice,
> wouldn't turning them into inline functions be an improvement? This is
> something gcc supports, it accomplishes the same thing, and has the added
> advantage of type checking.
> Or perhaps type checking macro arguments would be another fertile area for
> the Stanford Checker...

There are benefits to macros too. One that I like for debuggin is that
the C parser will unravel a macro within the context of the execution:

#ifdef DEBUG
#define KMALLOC(x,y) \
printk(__FILE__ ":%d: kmalloc(%d,%d")\n", __LINE__,x,y); \
#define KMALLOC(x,y) \

I think the benefit of a macro here is quite visible... you cannot do this
with an inline.

You may also look at some better reasons:

[btw I found this by looking for 'macros vs inline' on google/linux]



To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:24    [W:0.037 / U:10.176 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site