Skip to content

Commit

Permalink
[pyext] Update Makefile to disable warning Wconversion for older swig (
Browse files Browse the repository at this point in the history
…sonic-net#817)

Older swig version may generate some code that can warn on long to double conversion.
  • Loading branch information
kcudnik committed Apr 1, 2021
1 parent 1dbcaeb commit 1906fdf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
11 changes: 11 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([no])])
CXXFLAGS="$SAVED_FLAGS"

AC_SUBST(NO_CAST_FUNCTION_TYPE)

SAVED_FLAGS="$CXXFLAGS"
CXXFLAGS="-Wno-cast-function-type"
AC_MSG_CHECKING([whether CXX supports -Wno-cast-function-type])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])]
[AC_SUBST([NO_CAST_FUNCTION_TYPE], ["-Wno-cast-function-type"])],
[AC_MSG_RESULT([no])])
CXXFLAGS="$SAVED_FLAGS"

AC_SUBST(CFLAGS_COMMON)

AC_OUTPUT(Makefile
Expand Down
3 changes: 2 additions & 1 deletion pyext/py2/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ INCLUDE=-I../../SAI/inc -I../../SAI/meta -I../../SAI/experimental -I../../lib/in

_pysairedis_la_SOURCES = pysairedis_wrap.cpp $(SOURCES)
_pysairedis_la_CPPFLAGS = $(INCLUDE) -I/usr/include/python$(PYTHON_VERSION) $(AM_CPPFLAGS) $(CFLAGS_COMMON) \
-Wno-cast-qual -Wno-shadow -Wno-redundant-decls -Wno-cast-function-type
-Wno-cast-qual -Wno-shadow -Wno-redundant-decls -Wno-conversion $(NO_CAST_FUNCTION_TYPE)

_pysairedis_la_LDFLAGS = -module \
-lhiredis -lswsscommon -lpthread \
-L$(top_srcdir)/lib/src/.libs -lsairedis \
Expand Down
3 changes: 2 additions & 1 deletion pyext/py3/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ INCLUDE=-I../../SAI/inc -I../../SAI/meta -I../../SAI/experimental -I../../lib/in

_pysairedis_la_SOURCES = pysairedis_wrap.cpp $(SOURCES)
_pysairedis_la_CPPFLAGS = $(INCLUDE) -I/usr/include/python$(PYTHON3_VERSION) $(AM_CPPFLAGS) $(CFLAGS_COMMON) \
-Wno-cast-qual -Wno-shadow -Wno-redundant-decls -Wno-cast-function-type
-Wno-cast-qual -Wno-shadow -Wno-redundant-decls -Wno-conversion $(NO_CAST_FUNCTION_TYPE)

_pysairedis_la_LDFLAGS = -module \
-lhiredis -lswsscommon -lpthread \
-L$(top_srcdir)/lib/src/.libs -lsairedis \
Expand Down

0 comments on commit 1906fdf

Please sign in to comment.