blob: e6aedd78b5eda4570919a5a86d977ab720ac70f6 [file] [log] [blame]
Alexey Kodanev20eb0712014-04-11 13:26:59 +04001dnl Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved.
2dnl
3dnl This program is free software; you can redistribute it and/or
4dnl modify it under the terms of the GNU General Public License as
5dnl published by the Free Software Foundation; either version 2 of
6dnl the License, or (at your option) any later version.
7dnl
8dnl This program is distributed in the hope that it would be useful,
9dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11dnl GNU General Public License for more details.
12dnl
13dnl You should have received a copy of the GNU General Public License
14dnl along with this program; if not, write the Free Software Foundation,
15dnl Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16dnl
17dnl Author: Alexey Kodanev <alexey.kodanev@oracle.com>
18dnl
19
20AC_DEFUN([LTP_CHECK_CC_WARN_OLDSTYLE],[dnl
21
Nicolas Joly7d279ed2015-10-04 10:25:51 +020022wflag="-Wold-style-definition"
23AC_MSG_CHECKING([if $CC supports $wflag])
Alexey Kodanev20eb0712014-04-11 13:26:59 +040024
25backup_cflags="$CFLAGS"
Cyril Hrubis9fb4fcf2016-01-06 16:25:18 +010026CFLAGS="$CFLAGS $wflag"
Alexey Kodanev20eb0712014-04-11 13:26:59 +040027
28AC_LINK_IFELSE(
29 [AC_LANG_PROGRAM([])],
Nicolas Joly7d279ed2015-10-04 10:25:51 +020030 [GCC_WARN_OLDSTYLE="$wflag"]
Alexey Kodanev20eb0712014-04-11 13:26:59 +040031 [AC_MSG_RESULT([yes])],
32 [AC_MSG_RESULT([no])]
33)
34
35AC_SUBST(GCC_WARN_OLDSTYLE)
36CFLAGS="$backup_cflags"
37
38])