Bogus error for constant array sizes

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

 



Hello!

I'm running sparse (the current git version) on this file:

static const int len = 64;
void foo(void);
void foo(void)
{
        int buf[len];
}

sparse test.c 
test.c:5:10: error: bad constant expression

But if I remove "const", the error message goes away.

The message comes from file expand.c, function __get_expression_value().
expr->type is checked to be equal EXPR_VALUE (1), but it's EXPR_PREOP
(9).

-- 
Regards,
Pavel Roskin
--
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

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux