lkml.org 
[lkml]   [2006]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
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 12:35    [W:0.072 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site