|
|
|
Re: cannot size expression - exported array in kernel | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
On Mon, Nov 21, 2011 at 12:06 PM, Johannes Berg
<johannes@xxxxxxxxxxxxxxxx> wrote:
> Here's some code from net/wireless/util.c, expressed as a test case. I
> have no idea how to fix it. The actual output is:
>
> +sizeof-external.c:11:16: error: cannot size expression
>
> while none is expected.
>
> johannes
>
> /***** begin file validation/sizeof-external.c **** */
> /* #include file that declares it */
> extern const unsigned char bridge_tunnel_header[6];
>
> /* define it */
> const unsigned char bridge_tunnel_header[] = { 1, 2, 3, 4, 5, 6 };
> /* EXPORT_SYMBOL it */
> extern typeof(bridge_tunnel_header) bridge_tunnel_header; /* ... */
>
> static int bth_size(void)
> {
> return sizeof(bridge_tunnel_header);
> }
>
> /*
> * check-name: Check sizeof(kernel_exported_external_variable)
> *
> * check-error-start
> * check-error-end
> */.
I'm not really an expert in the sparse front-end either. Looking at
your test case, evaluate_sizeof() returns -1 which suggests
examine_symbol_type() doesn't handle typeof(bridge_tunnel_header)
properly.
Pekka
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Newbies FAQ] [Kernel List] [Site Home] [IETF Annouce] [DCCP] [Netdev] [Networking] [Security] [Bugtraq] [Photo] [Yosemite] [MIPS Linux] [ARM Linux] [Linux Security] [Linux RAID] [Linux SCSI] [DDR & Rambus] [Trinity Fuzzer Tool]