diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-03-05 20:21:51 +0100 |
|---|---|---|
| committer | Christopher Li <sparse@chrisli.org> | 2017-03-06 08:51:22 +0800 |
| commit | 44632081a3b54299e8899954efcd7133ef093259 (patch) | |
| tree | 839621fa83d0e8cd5bbe3eff06182133c53648c9 /validation | |
| parent | d4b88ffd878ca151cd03969d02522c456a264a7a (diff) | |
| download | sparse-dev-44632081a3b54299e8899954efcd7133ef093259.tar.gz | |
check the storage of C99 for-loop initializers
In C99, it is valid to declare a variable inside a
for-loop initializer but only when the storage is local
(automatic or register). Until now this was not enforced.
Fix this, when parsing declarations in a for-loop context,
by calling external_decl() with a validate method doing the
appropriate check of the storage.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/c99-for-loop-decl.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/validation/c99-for-loop-decl.c b/validation/c99-for-loop-decl.c index b9db8c9c..e813b0ae 100644 --- a/validation/c99-for-loop-decl.c +++ b/validation/c99-for-loop-decl.c @@ -30,7 +30,6 @@ static int c99(void) /* * check-name: C99 for-loop declarations - * check-known-to-fail * * check-error-start c99-for-loop-decl.c:22:27: warning: symbol with external linkage has initializer |
