From c019d7e8d8df404c798fb8f684d2690abb3c5d8c Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Thu, 1 Mar 2012 22:52:00 -0500 Subject: [PATCH] use -Wdeclaration-after-statement This makes gcc's behavior match MSVC's behavior, reducing the chances of code not building on Windows --- setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.py b/setup.py index e571fa9..ac22a5c 100755 --- a/setup.py +++ b/setup.py @@ -262,6 +262,12 @@ class CustomBuildExt(build_ext): # customize the build options for this compilier for e in self.extensions: e.extra_link_args.append("/MANIFEST") + if c == "unix": + # customize the build options for this compilier + for e in self.extensions: + e.extra_compile_args.append("-Wdeclaration-after-statement") + e.extra_compile_args.append("-Werror=declaration-after-statement") + # build in place, and in the build/ tree self.inplace = False