diff options
| author | Al Viro <viro@ftp.linux.org.uk> | 2009-03-09 23:32:16 +0000 |
|---|---|---|
| committer | Christopher Li <sparse@chrisli.org> | 2009-07-18 05:30:09 +0000 |
| commit | c14911db43a7229ba7a28ac23f4d1e569a2586ab (patch) | |
| tree | cdc075ecc76deb111f4d767c74aea8e1b3c5b782 /validation | |
| parent | 1aae3184cb1dbf95e1e07b4ac85cd3c70784fd32 (diff) | |
| download | sparse-dev-c14911db43a7229ba7a28ac23f4d1e569a2586ab.tar.gz | |
Fix enumeration constants' scope beginning
It starts after the end of enumerator; i.e. if we have
enum {
...
Foo = expression,
...
};
the scope of Foo starts only after the end of expression.
Rationale: 6.2.1p7.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/enum_scope.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/validation/enum_scope.c b/validation/enum_scope.c new file mode 100644 index 00000000..92ffc8ef --- /dev/null +++ b/validation/enum_scope.c @@ -0,0 +1,11 @@ +enum {A = 12}; + +static void f(void) +{ + enum {A = A + 1, B}; + char s[1 - 2 * (B != 14)]; +} + +/* + * check-name: enumeration constants' scope [6.2.1p7] + */ |
