mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Fix compile error for old versions of GCC.
Use -Wno-format-truncation only if supported by compiler. ASTERISK-27171 #close Change-Id: Iac0aed7a5bcaa16c21b7d62c4e4678d244c4ccb6
This commit is contained in:
@@ -29,7 +29,7 @@ include $(ASTTOPDIR)/Makefile.moddir_rules
|
|||||||
|
|
||||||
$(call MOD_ADD_C,app_confbridge,$(wildcard confbridge/*.c))
|
$(call MOD_ADD_C,app_confbridge,$(wildcard confbridge/*.c))
|
||||||
|
|
||||||
app_voicemail.o: _ASTCFLAGS+=-Wno-format-truncation
|
app_voicemail.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
|
||||||
|
|
||||||
ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
|
ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
|
||||||
LIBS+= -lres_ael_share.so -lres_monitor.so -lres_speech.so
|
LIBS+= -lres_ael_share.so -lres_monitor.so -lres_speech.so
|
||||||
|
@@ -29,7 +29,7 @@ $(call MOD_ADD_C,chan_pjsip,$(wildcard pjsip/*.c))
|
|||||||
$(call MOD_ADD_C,chan_dahdi,$(wildcard dahdi/*.c) sig_analog.c sig_pri.c sig_ss7.c)
|
$(call MOD_ADD_C,chan_dahdi,$(wildcard dahdi/*.c) sig_analog.c sig_pri.c sig_ss7.c)
|
||||||
$(call MOD_ADD_C,chan_misdn,misdn_config.c misdn/isdn_lib.c misdn/isdn_msg_parser.c)
|
$(call MOD_ADD_C,chan_misdn,misdn_config.c misdn/isdn_lib.c misdn/isdn_msg_parser.c)
|
||||||
|
|
||||||
chan_mgcp.o: _ASTCFLAGS+=-Wno-format-truncation
|
chan_mgcp.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
|
||||||
|
|
||||||
chan_misdn.o: _ASTCFLAGS+=-Imisdn
|
chan_misdn.o: _ASTCFLAGS+=-Imisdn
|
||||||
misdn_config.o: _ASTCFLAGS+=-Imisdn
|
misdn_config.o: _ASTCFLAGS+=-Imisdn
|
||||||
|
38
configure
vendored
38
configure
vendored
@@ -701,6 +701,7 @@ BIND8_CFLAGS
|
|||||||
AST_RPATH
|
AST_RPATH
|
||||||
AST_NATIVE_ARCH
|
AST_NATIVE_ARCH
|
||||||
AST_SHADOW_WARNINGS
|
AST_SHADOW_WARNINGS
|
||||||
|
AST_NO_FORMAT_TRUNCATION
|
||||||
AST_NO_STRICT_OVERFLOW
|
AST_NO_STRICT_OVERFLOW
|
||||||
AST_FORTIFY_SOURCE
|
AST_FORTIFY_SOURCE
|
||||||
AST_TRAMPOLINES
|
AST_TRAMPOLINES
|
||||||
@@ -1356,7 +1357,6 @@ infodir
|
|||||||
docdir
|
docdir
|
||||||
oldincludedir
|
oldincludedir
|
||||||
includedir
|
includedir
|
||||||
runstatedir
|
|
||||||
localstatedir
|
localstatedir
|
||||||
sharedstatedir
|
sharedstatedir
|
||||||
sysconfdir
|
sysconfdir
|
||||||
@@ -1541,7 +1541,6 @@ datadir='${datarootdir}'
|
|||||||
sysconfdir='${prefix}/etc'
|
sysconfdir='${prefix}/etc'
|
||||||
sharedstatedir='${prefix}/com'
|
sharedstatedir='${prefix}/com'
|
||||||
localstatedir='${prefix}/var'
|
localstatedir='${prefix}/var'
|
||||||
runstatedir='${localstatedir}/run'
|
|
||||||
includedir='${prefix}/include'
|
includedir='${prefix}/include'
|
||||||
oldincludedir='/usr/include'
|
oldincludedir='/usr/include'
|
||||||
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
||||||
@@ -1794,15 +1793,6 @@ do
|
|||||||
| -silent | --silent | --silen | --sile | --sil)
|
| -silent | --silent | --silen | --sile | --sil)
|
||||||
silent=yes ;;
|
silent=yes ;;
|
||||||
|
|
||||||
-runstatedir | --runstatedir | --runstatedi | --runstated \
|
|
||||||
| --runstate | --runstat | --runsta | --runst | --runs \
|
|
||||||
| --run | --ru | --r)
|
|
||||||
ac_prev=runstatedir ;;
|
|
||||||
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
|
|
||||||
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
|
|
||||||
| --run=* | --ru=* | --r=*)
|
|
||||||
runstatedir=$ac_optarg ;;
|
|
||||||
|
|
||||||
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
||||||
ac_prev=sbindir ;;
|
ac_prev=sbindir ;;
|
||||||
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
||||||
@@ -1940,7 +1930,7 @@ fi
|
|||||||
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
||||||
datadir sysconfdir sharedstatedir localstatedir includedir \
|
datadir sysconfdir sharedstatedir localstatedir includedir \
|
||||||
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
||||||
libdir localedir mandir runstatedir
|
libdir localedir mandir
|
||||||
do
|
do
|
||||||
eval ac_val=\$$ac_var
|
eval ac_val=\$$ac_var
|
||||||
# Remove trailing slashes.
|
# Remove trailing slashes.
|
||||||
@@ -2093,7 +2083,6 @@ Fine tuning of the installation directories:
|
|||||||
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
||||||
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
||||||
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
||||||
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
|
|
||||||
--libdir=DIR object code libraries [EPREFIX/lib]
|
--libdir=DIR object code libraries [EPREFIX/lib]
|
||||||
--includedir=DIR C header files [PREFIX/include]
|
--includedir=DIR C header files [PREFIX/include]
|
||||||
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
||||||
@@ -14927,7 +14916,7 @@ else
|
|||||||
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||||
since some C++ compilers masquerading as C compilers
|
since some C++ compilers masquerading as C compilers
|
||||||
incorrectly reject 9223372036854775807. */
|
incorrectly reject 9223372036854775807. */
|
||||||
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
|
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||||
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
||||||
&& LARGE_OFF_T % 2147483647 == 1)
|
&& LARGE_OFF_T % 2147483647 == 1)
|
||||||
? 1 : -1];
|
? 1 : -1];
|
||||||
@@ -14973,7 +14962,7 @@ else
|
|||||||
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||||
since some C++ compilers masquerading as C compilers
|
since some C++ compilers masquerading as C compilers
|
||||||
incorrectly reject 9223372036854775807. */
|
incorrectly reject 9223372036854775807. */
|
||||||
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
|
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||||
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
||||||
&& LARGE_OFF_T % 2147483647 == 1)
|
&& LARGE_OFF_T % 2147483647 == 1)
|
||||||
? 1 : -1];
|
? 1 : -1];
|
||||||
@@ -14997,7 +14986,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
|||||||
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||||
since some C++ compilers masquerading as C compilers
|
since some C++ compilers masquerading as C compilers
|
||||||
incorrectly reject 9223372036854775807. */
|
incorrectly reject 9223372036854775807. */
|
||||||
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
|
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||||
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
||||||
&& LARGE_OFF_T % 2147483647 == 1)
|
&& LARGE_OFF_T % 2147483647 == 1)
|
||||||
? 1 : -1];
|
? 1 : -1];
|
||||||
@@ -15042,7 +15031,7 @@ else
|
|||||||
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||||
since some C++ compilers masquerading as C compilers
|
since some C++ compilers masquerading as C compilers
|
||||||
incorrectly reject 9223372036854775807. */
|
incorrectly reject 9223372036854775807. */
|
||||||
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
|
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||||
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
||||||
&& LARGE_OFF_T % 2147483647 == 1)
|
&& LARGE_OFF_T % 2147483647 == 1)
|
||||||
? 1 : -1];
|
? 1 : -1];
|
||||||
@@ -15066,7 +15055,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
|||||||
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||||
since some C++ compilers masquerading as C compilers
|
since some C++ compilers masquerading as C compilers
|
||||||
incorrectly reject 9223372036854775807. */
|
incorrectly reject 9223372036854775807. */
|
||||||
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
|
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||||
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
||||||
&& LARGE_OFF_T % 2147483647 == 1)
|
&& LARGE_OFF_T % 2147483647 == 1)
|
||||||
? 1 : -1];
|
? 1 : -1];
|
||||||
@@ -19069,6 +19058,19 @@ $as_echo "no" >&6; }
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wno-format-truncation" >&5
|
||||||
|
$as_echo_n "checking for -Wno-format-truncation... " >&6; }
|
||||||
|
if $(${CC} -O2 -Wno-format-truncation -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||||
|
$as_echo "yes" >&6; }
|
||||||
|
AST_NO_FORMAT_TRUNCATION=-Wno-format-truncation
|
||||||
|
else
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||||
|
$as_echo "no" >&6; }
|
||||||
|
AST_NO_FORMAT_TRUNCATION=
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wshadow" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wshadow" >&5
|
||||||
$as_echo_n "checking for -Wshadow... " >&6; }
|
$as_echo_n "checking for -Wshadow... " >&6; }
|
||||||
if $(${CC} -Wshadow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
|
if $(${CC} -Wshadow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
|
||||||
|
10
configure.ac
10
configure.ac
@@ -1252,6 +1252,16 @@ else
|
|||||||
fi
|
fi
|
||||||
AC_SUBST(AST_NO_STRICT_OVERFLOW)
|
AC_SUBST(AST_NO_STRICT_OVERFLOW)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(for -Wno-format-truncation)
|
||||||
|
if $(${CC} -O2 -Wno-format-truncation -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AST_NO_FORMAT_TRUNCATION=-Wno-format-truncation
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
AST_NO_FORMAT_TRUNCATION=
|
||||||
|
fi
|
||||||
|
AC_SUBST(AST_NO_FORMAT_TRUNCATION)
|
||||||
|
|
||||||
AC_MSG_CHECKING(for -Wshadow)
|
AC_MSG_CHECKING(for -Wshadow)
|
||||||
if $(${CC} -Wshadow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
|
if $(${CC} -Wshadow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
|
@@ -140,7 +140,7 @@ endif
|
|||||||
$(CMD_PREFIX) rm $@.fix
|
$(CMD_PREFIX) rm $@.fix
|
||||||
|
|
||||||
ast_expr2f.o: _ASTCFLAGS+=-Wno-unused
|
ast_expr2f.o: _ASTCFLAGS+=-Wno-unused
|
||||||
cdr.o: _ASTCFLAGS+=-Wno-format-truncation
|
cdr.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
|
||||||
|
|
||||||
testexpr2: ast_expr2f.c ast_expr2.c ast_expr2.h
|
testexpr2: ast_expr2f.c ast_expr2.c ast_expr2.h
|
||||||
$(CC) -g -c -Iinclude -DSTANDALONE ast_expr2f.c
|
$(CC) -g -c -Iinclude -DSTANDALONE ast_expr2f.c
|
||||||
|
@@ -116,6 +116,7 @@ AST_ASTERISKSSL=@AST_ASTERISKSSL@
|
|||||||
AST_DECLARATION_AFTER_STATEMENT=@AST_DECLARATION_AFTER_STATEMENT@
|
AST_DECLARATION_AFTER_STATEMENT=@AST_DECLARATION_AFTER_STATEMENT@
|
||||||
AST_TRAMPOLINES=@AST_TRAMPOLINES@
|
AST_TRAMPOLINES=@AST_TRAMPOLINES@
|
||||||
AST_NO_STRICT_OVERFLOW=@AST_NO_STRICT_OVERFLOW@
|
AST_NO_STRICT_OVERFLOW=@AST_NO_STRICT_OVERFLOW@
|
||||||
|
AST_NO_FORMAT_TRUNCATION=@AST_NO_FORMAT_TRUNCATION@
|
||||||
AST_SHADOW_WARNINGS=@AST_SHADOW_WARNINGS@
|
AST_SHADOW_WARNINGS=@AST_SHADOW_WARNINGS@
|
||||||
AST_NESTED_FUNCTIONS=@AST_NESTED_FUNCTIONS@
|
AST_NESTED_FUNCTIONS=@AST_NESTED_FUNCTIONS@
|
||||||
AST_CLANG_BLOCKS=@AST_CLANG_BLOCKS@
|
AST_CLANG_BLOCKS=@AST_CLANG_BLOCKS@
|
||||||
|
Reference in New Issue
Block a user