summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBaruch Sterin <baruchs@gmail.com>2012-02-23 13:01:17 -0800
committerBaruch Sterin <baruchs@gmail.com>2012-02-23 13:01:17 -0800
commitaf51bdaf3ee3684ebccd14fa0546085fcf147139 (patch)
treec176793834fc330649da28e860507b1aec6b1047 /src
parenta87a3b4e330b6abf4411ccf72503cadd10aeb44e (diff)
downloadabc-af51bdaf3ee3684ebccd14fa0546085fcf147139.tar.gz
abc-af51bdaf3ee3684ebccd14fa0546085fcf147139.tar.bz2
abc-af51bdaf3ee3684ebccd14fa0546085fcf147139.zip
pyabc: silenced warnings in gcc
Diffstat (limited to 'src')
-rw-r--r--src/python/pyabc.i10
-rw-r--r--src/python/setup.py20
2 files changed, 23 insertions, 7 deletions
diff --git a/src/python/pyabc.i b/src/python/pyabc.i
index 37501a75..00e410a6 100644
--- a/src/python/pyabc.i
+++ b/src/python/pyabc.i
@@ -137,28 +137,28 @@ int n_cex_pis()
{
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
- return Abc_FrameReadCex(pAbc) ? Abc_FrameReadCexPiNum( Abc_FrameReadCex(pAbc) ) : -1;
+ return Abc_FrameReadCex(pAbc) ? Abc_FrameReadCexPiNum( pAbc ) : -1;
}
int n_cex_regs()
{
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
- return Abc_FrameReadCex(pAbc) ? Abc_FrameReadCexRegNum( Abc_FrameReadCex(pAbc) ) : -1;
+ return Abc_FrameReadCex(pAbc) ? Abc_FrameReadCexRegNum( pAbc ) : -1;
}
int cex_po()
{
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
- return Abc_FrameReadCex(pAbc) ? Abc_FrameReadCexPo( Abc_FrameReadCex(pAbc) ) : -1;
+ return Abc_FrameReadCex(pAbc) ? Abc_FrameReadCexPo( pAbc ) : -1;
}
int cex_frame()
{
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
- return Abc_FrameReadCex(pAbc) ? Abc_FrameReadCexFrame( Abc_FrameReadCex(pAbc) ) : -1;
+ return Abc_FrameReadCex(pAbc) ? Abc_FrameReadCexFrame( pAbc ) : -1;
}
int n_phases()
@@ -217,8 +217,6 @@ Abc_Cex_t* _cex_get_vec(int i)
void _cex_put(Abc_Cex_t* pCex)
{
- Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
-
if ( pCex )
{
pCex = Abc_CexDup(pCex, -1);
diff --git a/src/python/setup.py b/src/python/setup.py
index 7889aa87..032d28e5 100644
--- a/src/python/setup.py
+++ b/src/python/setup.py
@@ -1,8 +1,10 @@
import sys
+import sysconfig
from distutils.core import setup, Extension
from distutils.sysconfig import get_config_vars
from distutils import util
+from distutils.command.build_ext import build_ext
define_macros = []
libraries = []
@@ -31,6 +33,21 @@ else:
libraries.append( 'readline' )
library_dirs.append('./../../')
+
+# ugly hack to silence strict-prototype warnings
+
+class build_ext_subclass( build_ext ):
+
+ def build_extensions(self):
+
+ CC = sysconfig.get_config_var("CC")
+
+ if self.compiler.compiler_type == 'unix' and ( 'gcc' in CC or 'g++' in CC):
+ for e in self.extensions:
+ e.extra_compile_args.append( '-Wno-strict-prototypes' )
+
+ build_ext.build_extensions(self)
+
ext = Extension(
'_pyabc',
src_file,
@@ -44,5 +61,6 @@ setup(
name='pyabc',
version='1.0',
ext_modules=[ext],
- py_modules=['pyabc','getch','pyabc_split','redirect', 'reachx_cmd']
+ py_modules=['pyabc','getch','pyabc_split','redirect', 'reachx_cmd'],
+ cmdclass = {'build_ext': build_ext_subclass }
)