Re: one element array as name of struct typedef



richard@xxxxxxxxxxxxxxx (Richard Tobin) writes:

In article <fbjese$sr1$1@xxxxxxxx>,
Mark Bluemel <mark_bluemel@xxxxxxxxx> wrote:

typedef struct {
int len;
char *buf;
} foo[1];

I'm trying to work out what the value of such a technique would be.

My guess is that it's a neat trick for having objects that are (in
effect) automatically passed by reference. [...]

For what it's worth, the canonical example of this technique is
the jmp_buf type declared in <setjmp.h>.
--
char a[]="\n .CJacehknorstu";int putchar(int);int main(void){unsigned long b[]
={0x67dffdff,0x9aa9aa6a,0xa77ffda9,0x7da6aa6a,0xa67f6aaa,0xaa9aa9f6,0x11f6},*p
=b,i=24;for(;p+=!*p;*p/=4)switch(0[p]&3)case 0:{return 0;for(p--;i--;i--)case+
2:{i++;if(i)break;else default:continue;if(0)case 1:putchar(a[i&15]);break;}}}
.



Relevant Pages


Loading