diff options
| author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-07-22 14:28:43 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:02:14 -0700 |
| commit | 0bef08867e59f31ec2e96dcfa744644530e052d7 (patch) | |
| tree | 222a1a00b186fb0a9da40972ba8dd20945ba86ad /expand.c | |
| parent | 2f07fcbc2b0661e659d4d36abdc3edd0118079fc (diff) | |
| download | sparse-dev-0bef08867e59f31ec2e96dcfa744644530e052d7.tar.gz | |
Warn about assignments to 'const' types.
Diffstat (limited to 'expand.c')
| -rw-r--r-- | expand.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -243,6 +243,12 @@ static void expand_conditional(struct expression *expr) static void expand_assignment(struct expression *expr) { + struct expression *left = expr->left; + if (left) { + struct symbol *ctype = left->ctype; + if (ctype && (ctype->ctype.modifiers & MOD_CONST)) + warn(expr->pos, "assignment of const expression"); + } } static void expand_addressof(struct expression *expr) |
