diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-08-07 21:55:38 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-08-07 22:39:31 +0200 |
| commit | 561d0af146666fde424da06a994b9f9016ba6e05 (patch) | |
| tree | 07b5f3e9296469c361a3944a75be133fbc4b2e06 /validation | |
| parent | b0bd7d895a023b2ff71231ae7c1c5aee690f8a2a (diff) | |
| download | sparse-dev-561d0af146666fde424da06a994b9f9016ba6e05.tar.gz | |
add builtin support for __sync_{bool,val}_compare_and_swap()
In the kernel, the architecture s390 uses these builtins to
implement __atomic_cmpxchg() and friends. These builtins
are polymorphic, so they need some special evaluation.
These builtins are known to sparse but with a return type
of 'int' and the argument's types being ignored.
A problem occurs when used on a pointer type: the expected
type doesn't match 'int' and it can give warnings like:
warning: non size-preserving integer to pointer cast
So, improve the support for these builtins by:
*) checking the number of arguments
*) extract the type from the 1st argument
*) set the returned type to this type if needed
*) finally, do the typechecking by calling evaluate_arguments()
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/lkml/202008072005.Myrby1lg%25lkp@intel.com/
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/builtin-sync-cas.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/validation/builtin-sync-cas.c b/validation/builtin-sync-cas.c index e289eba2..846e21bb 100644 --- a/validation/builtin-sync-cas.c +++ b/validation/builtin-sync-cas.c @@ -16,7 +16,6 @@ static _Bool boz(_Bool *ptr) /* * check-name: builtin-sync-cas - * check-known-to-fail * * check-error-start builtin-sync-cas.c:9:49: warning: incorrect type in argument 2 (different base types) |
