diff --git a/SConstruct b/SConstruct index 55ca0efafe..9167acc133 100755 --- a/SConstruct +++ b/SConstruct @@ -375,10 +375,8 @@ elif main['CLANG']: 'Installed version:', main['CXXVERSION']) # clang has a few additional warnings that we disable, extraneous - # parantheses are allowed due to Ruby's printing of the AST, - # finally self assignments are allowed as the generated CPU code - # is relying on this - main.Append(CCFLAGS=['-Wno-parentheses', '-Wno-self-assign']) + # parantheses are allowed due to Ruby's printing of the AST. + main.Append(CCFLAGS=['-Wno-parentheses']) conf.CheckCxxFlag('-Wno-c99-designator') conf.CheckCxxFlag('-Wno-defaulted-function-deleted') diff --git a/src/arch/SConscript b/src/arch/SConscript index 3c7d6cfde4..73c6afbf4d 100644 --- a/src/arch/SConscript +++ b/src/arch/SConscript @@ -191,7 +191,10 @@ def ISADesc(desc, decoder_splits=1, exec_splits=1): # These generated files are also top level sources. def source_gen(name): add_gen(name) - Source(gen_file(name)) + append = {} + if env['CLANG']: + append['CCFLAGS'] = ['-Wno-self-assign'] + Source(gen_file(name), append=append) source_gen('decoder.cc') diff --git a/src/systemc/core/SConscript b/src/systemc/core/SConscript index 03730467a4..b5d0ea995b 100644 --- a/src/systemc/core/SConscript +++ b/src/systemc/core/SConscript @@ -62,4 +62,7 @@ if env['USE_SYSTEMC']: if env['USE_PYTHON']: Source('python.cc') Source('sc_main_python.cc') - Source('sc_time_python.cc') + append = {} + if env['CLANG']: + append['CCFLAGS'] = '-Wno-self-assign-overloaded' + Source('sc_time_python.cc', append=append)