diff options
author | Fernando Perez <fperez@fperez.org> | 2006-06-13 23:45:27 +0000 |
---|---|---|
committer | Fernando Perez <fperez@fperez.org> | 2006-06-13 23:45:27 +0000 |
commit | b65ac291abf9fb443f7e581635ee3ffe04415e66 (patch) | |
tree | d08fe339362d9e3130312143237341bc94515264 /numpy/distutils/ccompiler.py | |
parent | fcf1365e8c1617eb649955b2e2e430a25e867420 (diff) | |
download | numpy-b65ac291abf9fb443f7e581635ee3ffe04415e66.tar.gz |
Remove -Wstrict-prototypes from C++ compilations (it's an invalid option for
C++).
Diffstat (limited to 'numpy/distutils/ccompiler.py')
-rw-r--r-- | numpy/distutils/ccompiler.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/numpy/distutils/ccompiler.py b/numpy/distutils/ccompiler.py index ad4e4fb54..f068a997b 100644 --- a/numpy/distutils/ccompiler.py +++ b/numpy/distutils/ccompiler.py @@ -188,6 +188,19 @@ def CCompiler_customize(self, dist, need_cxx=0): log.info('customize %s' % (self.__class__.__name__)) customize_compiler(self) if need_cxx: + # In general, distutils uses -Wstrict-prototypes, but this option is + # not valid for C++ code, only for C. Remove it if it's there to + # avoid a spurious warning on every compilation. All the default + # options used by distutils can be extracted with: + + # from distutils import sysconfig + # sysconfig.get_config_vars('CC', 'CXX', 'OPT', 'BASECFLAGS', + # 'CCSHARED', 'LDSHARED', 'SO') + try: + self.compiler_so.remove('-Wstrict-prototypes') + except ValueError: + pass + if hasattr(self,'compiler') and self.compiler[0].find('gcc')>=0: if sys.version[:3]>='2.3': if not self.compiler_cxx: |