From 9e6f803254cbf3f5f491775debdc6593c3329da8 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Wed, 11 Feb 2015 10:23:24 -0500 Subject: base: Add compiler macros to add deprecation warnings Gcc and clang both provide an attribute that can be used to flag a function as deprecated at compile time. This changeset adds a gem5 compiler macro for that compiler feature. The macro can be used to indicate that a legacy API within gem5 has been deprecated and provide a graceful migration to the new API. --- src/SConscript | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/SConscript') diff --git a/src/SConscript b/src/SConscript index cffc4d157..a479464a1 100755 --- a/src/SConscript +++ b/src/SConscript @@ -1061,7 +1061,12 @@ def makeEnv(env, label, objsfx, strip = False, **kwargs): new_env.Append(LINKFLAGS='-fsanitize=undefined') werror_env = new_env.Clone() - werror_env.Append(CCFLAGS='-Werror') + # Treat warnings as errors but white list some warnings that we + # want to allow (e.g., deprecation warnings). + werror_env.Append(CCFLAGS=['-Werror', + '-Wno-error=deprecated-declarations', + '-Wno-error=deprecated', + ]) def make_obj(source, static, extra_deps = None): '''This function adds the specified source to the correct -- cgit v1.2.3