aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/expand.c
diff options
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-07-22 14:28:43 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:02:14 -0700
commit0bef08867e59f31ec2e96dcfa744644530e052d7 (patch)
tree222a1a00b186fb0a9da40972ba8dd20945ba86ad /expand.c
parent2f07fcbc2b0661e659d4d36abdc3edd0118079fc (diff)
downloadsparse-dev-0bef08867e59f31ec2e96dcfa744644530e052d7.tar.gz
Warn about assignments to 'const' types.
Diffstat (limited to 'expand.c')
-rw-r--r--expand.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/expand.c b/expand.c
index 469c49e0..c9ba5e0b 100644
--- a/expand.c
+++ b/expand.c
@@ -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)