Re: variant length array?

2016-04-06 Thread Bernd Petrovitsch
Hi! On Die, 2016-04-05 at 15:29 -0400, Wenda Ni wrote: [...] > I come across the following code in a kernel module code. It defines an > array whose length is variant at runtime, depending on the actual inputs. > It seems that kernel compiler supports this, which is obvious an error in > the stand

Re: variant length array?

2016-04-05 Thread Robert P. J. Day
On Tue, 5 Apr 2016, Bjørn Mork wrote: > "Robert P. J. Day" writes: > > On Tue, 5 Apr 2016, Wenda Ni wrote: > > > >> Hi all, > >> > >> I come across the following code in a kernel module code. It defines > >> an array whose length is variant at runtime, depending on the actual > >> inputs. It seem

Re: variant length array?

2016-04-05 Thread Rajat Sharma
On Tue, Apr 5, 2016 at 1:00 PM, Bjørn Mork wrote: > > "Robert P. J. Day" writes: > > On Tue, 5 Apr 2016, Wenda Ni wrote: > > > >> Hi all, > >> > >> I come across the following code in a kernel module code. It defines > >> an array whose length is variant at runtime, depending on the actual > >> i

Re: variant length array?

2016-04-05 Thread Wenda Ni
On Tue, Apr 5, 2016 at 4:19 PM, wrote: > On Tue, 05 Apr 2016 15:29:25 -0400, Wenda Ni said: > > > I come across the following code in a kernel module code. > > > u32 rxe_icrc_hdr(struct rxe_pkt_info *pkt, struct sk_buff *skb) > > Is this an out-of-tree module, or an older kernel? > > The current

Re: variant length array?

2016-04-05 Thread Valdis . Kletnieks
On Tue, 05 Apr 2016 15:29:25 -0400, Wenda Ni said: > I come across the following code in a kernel module code. > u32 rxe_icrc_hdr(struct rxe_pkt_info *pkt, struct sk_buff *skb) Is this an out-of-tree module, or an older kernel? The current linux-next tree has zero occurences of 'rxe_icrc_hdr' o

Re: variant length array?

2016-04-05 Thread Bjørn Mork
"Robert P. J. Day" writes: > On Tue, 5 Apr 2016, Wenda Ni wrote: > >> Hi all, >> >> I come across the following code in a kernel module code. It defines >> an array whose length is variant at runtime, depending on the actual >> inputs. It seems that kernel compiler supports this, which is >> obvio

Re: variant length array?

2016-04-05 Thread Robert P. J. Day
On Tue, 5 Apr 2016, Wenda Ni wrote: > Hi all, > > I come across the following code in a kernel module code. It defines > an array whose length is variant at runtime, depending on the actual > inputs. It seems that kernel compiler supports this, which is > obvious an error in the standard ANSI C. D

variant length array?

2016-04-05 Thread Wenda Ni
Hi all, I come across the following code in a kernel module code. It defines an array whose length is variant at runtime, depending on the actual inputs. It seems that kernel compiler supports this, which is obvious an error in the standard ANSI C. Do I have the correct understanding on it? Thank