cannot size expression - exported array in kernel
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
*/
Quoted 23 lines · Johannes Berg
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_SYMBOLit */
externtypeof(bridge_tunnel_header)bridge_tunnel_header; /* ... */static int
bth_size(void)
{
returnsizeof(bridge_tunnel_header);
}
Quoted 6 lines
/*
* check-name: Checksizeof(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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Christopher Li
maintainerQuoted 4 lines · Pekka Enberg
I'm not really an expert in the sparse front-end either. Looking at your test case,
evaluate_sizeof()returns -1 which suggestsexamine_symbol_type()doesn't handletypeof(bridge_tunnel_header)properly.
I will add that to a validation test case and take a closer look.
Chris