[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.61.0611051225130.12727@yvahk01.tjqt.qr>
Date: Sun, 5 Nov 2006 12:31:05 +0100 (MET)
From: Jan Engelhardt <jengelh@...ux01.gwdg.de>
To: Willy Tarreau <w@....eu>
cc: Mikulas Patocka <mikulas@...ax.karlin.mff.cuni.cz>,
Linus Torvalds <torvalds@...l.org>,
linux-kernel@...r.kernel.org
Subject: Re: New filesystem for Linux
>> BTW do you find uppercase typedefs like
>> typedef struct {
>> ...
>> } SPADFNODE;
>> confusing too?
>
>Yes for the reason above. Also, we don't much use type definitions for
>structures, because it's easier to understand "struct spadfnode *node"
>in a function declaration than "SPADFNODE *node".
It gets worse when code authors begin to use
typedef struct { ... } MYSTRUCT, *PMYSTRUCT, **PPMYSTRUCT;
Most certainly you will run into "passing argument from incompatible
pointer"[1] and "request for member ■a■ in something not a structure or
union"[2] and "invalid type argument of ■->■"[3] (BTW I hate gcc using
Unicode chars in its output which are not displayed in the console):
struct foo {
int bar;
} ST, *PST;
void foobar(ST a) { // [1]
a->bar = 1;
foobar2(a); // [3]
}
void foobar2(PST a) { // [2]
a.bar = 1;
}
So I much rather like to see all the 'funky stars' (struct foo *) in the
parameter list, instead of trying to keep track of how many of them a
PST carries.
-`J'
--
Powered by blists - more mailing lists