Re: gcc: loop do not terminate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Sorry if this is OT and a dumb question, but are you sure you want

On Mon, May 13, 2013 at 8:20 PM, LANGLOIS Olivier PIS -EXT
<olivier.pis.langlois@xxxxxxxxxxxxxxxxxxxx> wrote:
[...]
> struct B
> {
>         int numelem;
>         /*
>          * Old C trick to define a dynamically sizable array just by allocating
>          * sizeof(B) + (numelem-1)*sizeof(A) memory.
>          */
>         A   item[1];
> };
>

one item vs.

> void initArr(B *p);
>
> lano1106@hpmini ~/dev/gcc-test $ cat test1_init.cpp
> #include "test1.h"
>
> void initArr(B *p)
> {
>         p->numelem = 2;
>         p->item[0].a = 1;
>         p->item[1].a = 2;
> }
>

two items?

cheers!
mar77i


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux