Skip to contentSkip to conversation

Allow to check mdadm with clangs static checker (scan-build)

PATCH In review Bernd Schubert 2 participants 3 messages Jan 20, 2014 – Jan 21, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow to check mdadm with clangs static checker (scan-build)

Clangs scan-build tool (static checker) set the environmental variable CC, so Makefile should allow to use that value.

---
 Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 043bcea..63cc3ac 100644
@@ -41,7 +41,7 @@ KLIBC=/home/src/klibc/klibc-0.77
 
 KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
 
-CC = $(CROSS_COMPILE)gcc
+CC ?= $(CROSS_COMPILE)gcc
 CXFLAGS ?= -ggdb
 CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
 ifdef WARN_UNUSED
#1 lore raw
Quoted 13 lines · On Mon, 20 Jan 2014 17:14:12 +0100 Bernd Schubert <[email protected]>…

Clangs scan-build tool (static checker) set the environmental variable CC, so Makefile should allow to use that value.

---
 Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +0 -0
index 043bcea..63cc3ac 100644

Makefile KLIBC=/home/src/klibc/klibc-0.77 · line 47

Quoted 8 lines
Makefile +1 -1
@@ -41,7 +41,7 @@ KLIBC=/home/src/klibc/klibc-0.77
 
 KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
 
-CC = $(CROSS_COMPILE)gcc
+CC ?= $(CROSS_COMPILE)gcc
 CXFLAGS ?= -ggdb
 CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
 ifdef WARN_UNUSED

I'm not exactly against this, but presumably you could tell scan-build to run

make CC=$CC

to achieve the same effect with no patch ??

i.e.

scan-build 'make CC=$CC'

But maybe I'll apply it anyway.

NeilBrown

#2 lore raw
Quoted 27 lines · NeilBrown
Quoted 13 lines · On Mon, 20 Jan 2014 17:14:12 +0100 Bernd Schubert <[email protected]>…

Clangs scan-build tool (static checker) set the environmental variable CC, so Makefile should allow to use that value.

---
  Makefile |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +0 -0
index 043bcea..63cc3ac 100644

Makefile KLIBC=/home/src/klibc/klibc-0.77 · line 47

Quoted 8 lines
Makefile +1 -1
@@ -41,7 +41,7 @@ KLIBC=/home/src/klibc/klibc-0.77
 
  KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
 
-CC = $(CROSS_COMPILE)gcc
+CC ?= $(CROSS_COMPILE)gcc
  CXFLAGS ?= -ggdb
  CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
  ifdef WARN_UNUSED

I'm not exactly against this, but presumably you could tell scan-build to run

Quoted 7 lines

make CC=$CC

to achieve the same effect with no patch ??

i.e.

scan-build 'make CC=$CC'

Yeah, that would also work. IMHO, it is just not very intuitive.
Maybe I should submit a patch for the man page of the debian package and upstream docs.

Quoted 2 lines

But maybe I'll apply it anyway.

Would be great.

Thanks,
Bernd