linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* for (int i = expr; ....)
@ 2008-02-21 15:05 Pierre Habouzit
  2008-02-22 20:26 ` Chris Li
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre Habouzit @ 2008-02-21 15:05 UTC (permalink / raw)
  To: linux-sparse

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

Sparse doesn't support the C99 construct `for (int i = expr; ....)` properly.
for example, the following C code:

    #include <stdlib.h>

    int main(void)
    {
        for (int i = atoi("12"); i < 10; i++);
        return 0;
    }

make sparse spit:

    $ sparse -Wall test.c
    test.c:5:22: warning: call with no type!

In fact sparse doesn't support 'expr' to be a complex enough expression
(expressions that can be folded work, but not any other afaict).

I assume something has to be done in parser.c, but I'm not really sure it's the
sole place…


-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2008-02-23 13:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-21 15:05 for (int i = expr; ....) Pierre Habouzit
2008-02-22 20:26 ` Chris Li
2008-02-23 13:33   ` Pierre Habouzit

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).