linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bogus error for constant array sizes
@ 2008-05-29 20:01 Pavel Roskin
  2008-05-29 22:10 ` Pavel Roskin
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Roskin @ 2008-05-29 20:01 UTC (permalink / raw)
  To: linux-sparse

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-29 22:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-29 20:01 Bogus error for constant array sizes Pavel Roskin
2008-05-29 22:10 ` Pavel Roskin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).