ck_pr: default to cc builtin implementations for static analysers

master
Paul Khuong 5 years ago
parent cb63256ae2
commit c896a8f33c

2
configure vendored

@ -202,7 +202,7 @@ for option; do
echo " --memory-model=N Specify memory model (currently tso, pso or rmo)" echo " --memory-model=N Specify memory model (currently tso, pso or rmo)"
echo " --vma-bits=N Specify valid number of VMA bits" echo " --vma-bits=N Specify valid number of VMA bits"
echo " --platform=N Force the platform type, instead of relying on autodetection" echo " --platform=N Force the platform type, instead of relying on autodetection"
echo " --use-cc-builtins Use the compiler atomic bultin functions, instead of the CK implementation" echo " --use-cc-builtins Use the compiler atomic builtin functions, instead of the CK implementation"
echo " --disable-double Don't generate any of the functions using the \"double\" type" echo " --disable-double Don't generate any of the functions using the \"double\" type"
echo echo
echo "The following options will affect specific platform-dependent generated code." echo "The following options will affect specific platform-dependent generated code."

@ -34,7 +34,20 @@
#include <ck_stdint.h> #include <ck_stdint.h>
#include <ck_stdbool.h> #include <ck_stdbool.h>
#ifndef CK_USE_CC_BUILTINS /*
* Default to using builtins for clang analyzer, coverity, and sparse:
* inline assembly is often too opaque for useful analysis. Override
* the defaults by defining CK_USE_CC_BUILTINS=0 or 1.
*/
#if !defined(CK_USE_CC_BUILTINS)
#if defined(__clang_analyzer__) || defined(__COVERITY__) || defined(__CHECKER__)
#define CK_USE_CC_BUILTINS 1
#else
#define CK_USE_CC_BUILTINS 0
#endif
#endif
#if !CK_USE_CC_BUILTINS
#if defined(__x86_64__) #if defined(__x86_64__)
#include "gcc/x86_64/ck_pr.h" #include "gcc/x86_64/ck_pr.h"
#elif defined(__x86__) #elif defined(__x86__)

Loading…
Cancel
Save