lkml.org 
[lkml]   [2006]   [Nov]   [5]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
/
DateSun, 5 Nov 2006 12:31:05 +0100 (MET)
FromJan Engelhardt <>
SubjectRe: 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'
-- 
\
 
 \ /
  Last update: 2006-11-05 10:35    [W:0.294 / U:0.090 seconds]
©2003-2008 Jasper Spaans