2005-03-13 05:11:19

by John Cherry

[permalink] [raw]
Subject: IA32 (2.6.11 - 2005-03-12.16.00) - 56 New warnings

drivers/media/dvb/frontends/dvb-pll.c:104: warning: (near initialization for `dvb_pll_unknown_1.entries')
drivers/media/dvb/frontends/dvb-pll.c:104: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:105: warning: (near initialization for `dvb_pll_unknown_1.entries')
drivers/media/dvb/frontends/dvb-pll.c:105: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:106: warning: (near initialization for `dvb_pll_unknown_1.entries')
drivers/media/dvb/frontends/dvb-pll.c:106: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:107: warning: (near initialization for `dvb_pll_unknown_1.entries')
drivers/media/dvb/frontends/dvb-pll.c:107: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:108: warning: (near initialization for `dvb_pll_unknown_1.entries')
drivers/media/dvb/frontends/dvb-pll.c:108: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:109: warning: (near initialization for `dvb_pll_unknown_1.entries')
drivers/media/dvb/frontends/dvb-pll.c:109: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:110: warning: (near initialization for `dvb_pll_unknown_1.entries')
drivers/media/dvb/frontends/dvb-pll.c:110: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:111: warning: (near initialization for `dvb_pll_unknown_1.entries')
drivers/media/dvb/frontends/dvb-pll.c:111: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:112: warning: (near initialization for `dvb_pll_unknown_1.entries')
drivers/media/dvb/frontends/dvb-pll.c:112: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:38: warning: (near initialization for `dvb_pll_thomson_dtt7579.entries')
drivers/media/dvb/frontends/dvb-pll.c:38: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:39: warning: (near initialization for `dvb_pll_thomson_dtt7579.entries')
drivers/media/dvb/frontends/dvb-pll.c:39: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:40: warning: (near initialization for `dvb_pll_thomson_dtt7579.entries')
drivers/media/dvb/frontends/dvb-pll.c:40: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:41: warning: (near initialization for `dvb_pll_thomson_dtt7579.entries')
drivers/media/dvb/frontends/dvb-pll.c:41: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:42: warning: (near initialization for `dvb_pll_thomson_dtt7579.entries')
drivers/media/dvb/frontends/dvb-pll.c:42: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:53: warning: (near initialization for `dvb_pll_thomson_dtt7610.entries')
drivers/media/dvb/frontends/dvb-pll.c:53: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:54: warning: (near initialization for `dvb_pll_thomson_dtt7610.entries')
drivers/media/dvb/frontends/dvb-pll.c:54: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:55: warning: (near initialization for `dvb_pll_thomson_dtt7610.entries')
drivers/media/dvb/frontends/dvb-pll.c:55: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:73: warning: (near initialization for `dvb_pll_thomson_dtt759x.entries')
drivers/media/dvb/frontends/dvb-pll.c:73: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:74: warning: (near initialization for `dvb_pll_thomson_dtt759x.entries')
drivers/media/dvb/frontends/dvb-pll.c:74: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:75: warning: (near initialization for `dvb_pll_thomson_dtt759x.entries')
drivers/media/dvb/frontends/dvb-pll.c:75: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:76: warning: (near initialization for `dvb_pll_thomson_dtt759x.entries')
drivers/media/dvb/frontends/dvb-pll.c:76: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:77: warning: (near initialization for `dvb_pll_thomson_dtt759x.entries')
drivers/media/dvb/frontends/dvb-pll.c:77: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:78: warning: (near initialization for `dvb_pll_thomson_dtt759x.entries')
drivers/media/dvb/frontends/dvb-pll.c:78: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:89: warning: (near initialization for `dvb_pll_lg_z201.entries')
drivers/media/dvb/frontends/dvb-pll.c:89: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:90: warning: (near initialization for `dvb_pll_lg_z201.entries')
drivers/media/dvb/frontends/dvb-pll.c:90: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:91: warning: (near initialization for `dvb_pll_lg_z201.entries')
drivers/media/dvb/frontends/dvb-pll.c:91: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:92: warning: (near initialization for `dvb_pll_lg_z201.entries')
drivers/media/dvb/frontends/dvb-pll.c:92: warning: excess elements in array initializer
drivers/media/dvb/frontends/dvb-pll.c:93: warning: (near initialization for `dvb_pll_lg_z201.entries')
drivers/media/dvb/frontends/dvb-pll.c:93: warning: excess elements in array initializer


2005-03-13 12:40:29

by Johannes Stezenbach

[permalink] [raw]
Subject: Re: IA32 (2.6.11 - 2005-03-12.16.00) - 56 New warnings

On Sat, Mar 12, 2005 at 09:08:45PM -0800, John Cherry wrote:
> drivers/media/dvb/frontends/dvb-pll.c:104: warning: (near initialization for `dvb_pll_unknown_1.entries')
> drivers/media/dvb/frontends/dvb-pll.c:104: warning: excess elements in array initializer
> drivers/media/dvb/frontends/dvb-pll.c:105: warning: (near initialization for `dvb_pll_unknown_1.entries')
> drivers/media/dvb/frontends/dvb-pll.c:105: warning: excess elements in array initializer
[snip]

Gerd's original patch had

struct dvb_pll_desc {
char *name;
u32 min;
u32 max;
void (*setbw)(u8 *buf, int bandwidth);
int count;
struct {
u32 limit;
u32 offset;
u32 stepsize;
u8 cb1;
u8 cb2;
} entries[];
};

while 2.6.11-mm3 changed it into entries[0]. I assume this was made
for gcc-4.0 compatibility? But the element type for entries is
fully defined, so it should not be a problem (as long as no one tries to
created arrays of struct dvb_pll_desc)?

Johannes

2005-03-13 19:35:51

by Andrew Morton

[permalink] [raw]
Subject: Re: IA32 (2.6.11 - 2005-03-12.16.00) - 56 New warnings

Johannes Stezenbach <[email protected]> wrote:
>
> On Sat, Mar 12, 2005 at 09:08:45PM -0800, John Cherry wrote:
> > drivers/media/dvb/frontends/dvb-pll.c:104: warning: (near initialization for `dvb_pll_unknown_1.entries')
> > drivers/media/dvb/frontends/dvb-pll.c:104: warning: excess elements in array initializer
> > drivers/media/dvb/frontends/dvb-pll.c:105: warning: (near initialization for `dvb_pll_unknown_1.entries')
> > drivers/media/dvb/frontends/dvb-pll.c:105: warning: excess elements in array initializer
> [snip]
>
> Gerd's original patch had
>
> struct dvb_pll_desc {
> char *name;
> u32 min;
> u32 max;
> void (*setbw)(u8 *buf, int bandwidth);
> int count;
> struct {
> u32 limit;
> u32 offset;
> u32 stepsize;
> u8 cb1;
> u8 cb2;
> } entries[];
> };
>
> while 2.6.11-mm3 changed it into entries[0].

The original code failed to compile with gcc-2.95.4, so I stuck the [0] in
there, then was vaguely surprised when no warnings came out. Seems that
later compilers _do_ warn.

I guess we could put a 9 in there.

2005-03-14 09:46:02

by Gerd Knorr

[permalink] [raw]
Subject: Re: IA32 (2.6.11 - 2005-03-12.16.00) - 56 New warnings

> > struct dvb_pll_desc {
[ ... ]
> > struct {
[ ... ]
> > } entries[];
> > };
> >
> > while 2.6.11-mm3 changed it into entries[0].
>
> The original code failed to compile with gcc-2.95.4, so I stuck the [0] in
> there, then was vaguely surprised when no warnings came out. Seems that
> later compilers _do_ warn.
>
> I guess we could put a 9 in there.

Yep, that should do, I think that is enougth for all existing
entries ...

Gerd

--
#define printk(args...) fprintf(stderr, ## args)