[LAD] "enhanced event port" LV2 extension proposal

Dave Robillard drobilla at connect.carleton.ca
Fri Nov 30 00:58:33 UTC 2007


On Fri, 2007-11-30 at 00:23 +0000, Krzysztof Foltman wrote:
> Dave Robillard wrote:
> >> Because char* usually means, you know, a pointer, not a variable length
> >> array :)
> >>     
> > .... char buf[] is, you know, equivalent to char* buf.  You do know C,
> > yes? ;)
> >   
> You *do* know C, yes? Well enough to judge others?
> 
> Hint: try this little proggy (gcc should compile it fine):
> 
> #include <stdio.h>
> int main(int argc, char *argv[])
> {
>   struct X
>   {
>     int a;
>     char buf[];
>   };
>   struct Y
>   {
>     int a;
>     char *buf;
>   };
> 
>   printf("%d %d\n", sizeof(struct X), sizeof(struct Y));
> }

Sigh.  In /this case/ they are the same, because the data directly
follows (the char* member doesn't even really have to be there, it's
just convenient. It could literally be just 'char', for example).  The
data always did directly follow, and this has all been working just fine
for ages now.  You just didn't bother to understand the existing LV2
MIDI before trying to extend it, and an awful lot of pointless ranting
about cache and optimisation or whatever was the result.   

Touche, smartass :P

-DR-




More information about the Linux-audio-dev mailing list