Re: [LAD] "enhanced event port" LV2 extension proposal

From: Dave Robillard <drobilla@email-addr-hidden>
Date: Fri Nov 30 2007 - 02:58:33 EET

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-

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Fri Nov 30 04:15:06 2007

This archive was generated by hypermail 2.1.8 : Fri Nov 30 2007 - 04:15:06 EET