Re: [PATCH 4/8] riscv: ensure RISC-V C model definitions are passed to static analyzers

2019-10-22 Thread Palmer Dabbelt
On Thu, 17 Oct 2019 21:39:29 PDT (-0700), Paul Walmsley wrote: On Fri, 18 Oct 2019, Luc Van Oostenryck wrote: On Thu, Oct 17, 2019 at 05:49:25PM -0700, Paul Walmsley wrote: > Static analysis tools such as sparse don't set the RISC-V C model > preprocessor directives such as "__riscv_cmodel_meda

Re: [PATCH 4/8] riscv: ensure RISC-V C model definitions are passed to static analyzers

2019-10-17 Thread Luc Van Oostenryck
On Thu, Oct 17, 2019 at 09:39:29PM -0700, Paul Walmsley wrote: > On Fri, 18 Oct 2019, Luc Van Oostenryck wrote: > > On Thu, Oct 17, 2019 at 05:49:25PM -0700, Paul Walmsley wrote: > > > ifeq ($(CONFIG_CMODEL_MEDANY),y) > > > KBUILD_CFLAGS += -mcmodel=medany > > > + CHECKFLAGS += -D__riscv_cm

Re: [PATCH 4/8] riscv: ensure RISC-V C model definitions are passed to static analyzers

2019-10-17 Thread Paul Walmsley
On Fri, 18 Oct 2019, Luc Van Oostenryck wrote: > On Thu, Oct 17, 2019 at 05:49:25PM -0700, Paul Walmsley wrote: > > Static analysis tools such as sparse don't set the RISC-V C model > > preprocessor directives such as "__riscv_cmodel_medany", set by the C > > compilers. This causes the static ana

Re: [PATCH 4/8] riscv: ensure RISC-V C model definitions are passed to static analyzers

2019-10-17 Thread Luc Van Oostenryck
On Thu, Oct 17, 2019 at 05:49:25PM -0700, Paul Walmsley wrote: > Static analysis tools such as sparse don't set the RISC-V C model > preprocessor directives such as "__riscv_cmodel_medany", set by the C > compilers. This causes the static analyzers to evaluate different > preprocessor paths than C

[PATCH 4/8] riscv: ensure RISC-V C model definitions are passed to static analyzers

2019-10-17 Thread Paul Walmsley
Static analysis tools such as sparse don't set the RISC-V C model preprocessor directives such as "__riscv_cmodel_medany", set by the C compilers. This causes the static analyzers to evaluate different preprocessor paths than C compilers would. Fix this by defining the appropriate C model macros