diff options
author | Ben Dooks <ben.dooks@codethink.co.uk> | 2018-10-30 10:36:26 +0000 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-10-05 12:56:10 +0200 |
commit | efc02e9ee225d1327be004181da74f59f2aa2c11 (patch) | |
tree | 04803b041d535bde1eecd7aab2be20be38290721 /evaluate.h | |
parent | 375690b61e8ec4735b19bcead756ba526edab57e (diff) | |
download | sparse-efc02e9ee225d1327be004181da74f59f2aa2c11.tar.gz |
evaluate: check variadic argument types against format stringformat-check
The variadic argument code did not check any of the variadic arguments
as it did not previously know the possible type. Now we have the possible
formatting information stored in the ctype, we can do some checks on the
printf formatting types.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'evaluate.h')
-rw-r--r-- | evaluate.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -28,8 +28,17 @@ void evaluate_symbol_list(struct symbol_list *list); /// // evaluate the arguments of a function +// @fn: the symbol of the prototype // @argtypes: the list of the types in the prototype // @args: the list of the effective arguments -int evaluate_arguments(struct symbol_list *argtypes, struct expression_list *args); +int evaluate_arguments(struct symbol *fn, struct symbol_list *argtypes, struct expression_list *args); + +/// +// check if assignment types are compatible +// @target: the type of the right-hand side +// @rp: the expression corresponding to the left-hand side +// @typediff: a pointer for details about the type difference, if any +// @return: a non-zero value of the types are compatible, 0 otherwise +int check_assignment_types(struct symbol *target, struct expression **rp, const char **typediff); #endif |