summaryrefslogtreecommitdiff
path: root/src/SConscript
diff options
context:
space:
mode:
Diffstat (limited to 'src/SConscript')
-rw-r--r--src/SConscript17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/SConscript b/src/SConscript
index 7f7098aaab..5ab18ef52a 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -1,9 +1,9 @@
from building import *
+from gcc import GetGCCLikePLATFORM
import os
src = Glob('*.c')
cwd = GetCurrentDir()
-
inc = [os.path.join(cwd, '..', 'include')]
if GetDepend('RT_USING_SMALL_MEM') == False:
@@ -30,6 +30,19 @@ if GetDepend('RT_USING_SMP') == False:
if GetDepend('RT_USING_SMP') == True:
SrcRemove(src, ['scheduler_up.c'])
-group = DefineGroup('Kernel', src, depend = [''], CPPPATH = inc, CPPDEFINES = ['__RTTHREAD__'])
+LOCAL_CFLAGS = ''
+
+if rtconfig.PLATFORM in GetGCCLikePLATFORM():
+ LOCAL_CFLAGS += ' -Wunused' # unused warning
+ LOCAL_CFLAGS += ' -Wformat -Wformat-security' # printf/scanf format warning
+ LOCAL_CFLAGS += ' -Warray-bounds -Wuninitialized' # memory access warning
+ LOCAL_CFLAGS += ' -Wreturn-type -Wcomment -Wswitch' # code style warning
+ LOCAL_CFLAGS += ' -Wparentheses -Wlogical-op ' # operation warning
+ # LOCAL_CFLAGS += ' -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes' # function declaration warning
+ if 'mips' not in rtconfig.PREFIX: # mips toolchain does not support
+ LOCAL_CFLAGS += ' -Wimplicit-fallthrough' # implicit fallthrough warning
+ LOCAL_CFLAGS += ' -Wduplicated-cond -Wduplicated-branches' # duplicated condition warning
+
+group = DefineGroup('Kernel', src, depend=[''], CPPPATH=inc, CPPDEFINES=['__RTTHREAD__'], LOCAL_CFLAGS=LOCAL_CFLAGS)
Return('group')