diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-11-19 01:37:05 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-11-19 21:05:06 +0100 |
commit | 2c5eeff0f1741761196b8b2cfc86b71ef9ef9548 (patch) | |
tree | 4d998d6e54c483c23acb3176a744ff8a49d4ef3c | |
parent | 64003b0b9741888cd801e8822b3adb421876b39f (diff) | |
download | sparse-2c5eeff0f1741761196b8b2cfc86b71ef9ef9548.tar.gz |
fix assignment: pointer to __pure/__noreturn function to void *
It's fine for a pointer to a __pure or a __noreturn function
to be assigned to a void pointer (since this pointer can't
be used to make an indirect function call without another cast).
Ensure this by ignoring the corresponding modifiers when checking
such assignments.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | evaluate.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1464,7 +1464,7 @@ static int check_assignment_types(struct symbol *target, struct expression **rp, */ if (b1->type == SYM_FN) mod1 |= MOD_CONST; - if (mod2 & ~mod1) { + if (mod2 & ~mod1 & ~MOD_FUN_ATTR) { *typediff = "different modifiers"; return 0; } |