Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit67c03c6

Browse files
committed
Add -Wlogical-op to standard compiler flags, if supported
1 parent1746ba9 commit67c03c6

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

‎configure

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4072,6 +4072,66 @@ if test x"$pgac_cv_prog_cc_cflags__Wendif_labels" = x"yes"; then
40724072
CFLAGS="$CFLAGS -Wendif-labels"
40734073
fi
40744074

4075+
{ $as_echo "$as_me:$LINENO: checking whether $CC supports -Wlogical-op" >&5
4076+
$as_echo_n "checking whether $CC supports -Wlogical-op... " >&6; }
4077+
if test "${pgac_cv_prog_cc_cflags__Wlogical_op+set}" = set; then
4078+
$as_echo_n "(cached) " >&6
4079+
else
4080+
pgac_save_CFLAGS=$CFLAGS
4081+
CFLAGS="$pgac_save_CFLAGS -Wlogical-op"
4082+
ac_save_c_werror_flag=$ac_c_werror_flag
4083+
ac_c_werror_flag=yes
4084+
cat >conftest.$ac_ext <<_ACEOF
4085+
/* confdefs.h. */
4086+
_ACEOF
4087+
cat confdefs.h >>conftest.$ac_ext
4088+
cat >>conftest.$ac_ext <<_ACEOF
4089+
/* end confdefs.h. */
4090+
4091+
int
4092+
main ()
4093+
{
4094+
4095+
;
4096+
return 0;
4097+
}
4098+
_ACEOF
4099+
rm -f conftest.$ac_objext
4100+
if { (ac_try="$ac_compile"
4101+
case "(($ac_try" in
4102+
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4103+
*) ac_try_echo=$ac_try;;
4104+
esac
4105+
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4106+
$as_echo "$ac_try_echo") >&5
4107+
(eval "$ac_compile") 2>conftest.er1
4108+
ac_status=$?
4109+
grep -v '^ *+' conftest.er1 >conftest.err
4110+
rm -f conftest.er1
4111+
cat conftest.err >&5
4112+
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4113+
(exit $ac_status); } && {
4114+
test -z "$ac_c_werror_flag" ||
4115+
test ! -s conftest.err
4116+
} && test -s conftest.$ac_objext; then
4117+
pgac_cv_prog_cc_cflags__Wlogical_op=yes
4118+
else
4119+
$as_echo "$as_me: failed program was:" >&5
4120+
sed 's/^/| /' conftest.$ac_ext >&5
4121+
4122+
pgac_cv_prog_cc_cflags__Wlogical_op=no
4123+
fi
4124+
4125+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4126+
ac_c_werror_flag=$ac_save_c_werror_flag
4127+
CFLAGS="$pgac_save_CFLAGS"
4128+
fi
4129+
{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__Wlogical_op" >&5
4130+
$as_echo "$pgac_cv_prog_cc_cflags__Wlogical_op" >&6; }
4131+
if test x"$pgac_cv_prog_cc_cflags__Wlogical_op" = x"yes"; then
4132+
CFLAGS="$CFLAGS -Wlogical-op"
4133+
fi
4134+
40754135
{ $as_echo "$as_me:$LINENO: checking whether $CC supports -Wmissing-format-attribute" >&5
40764136
$as_echo_n "checking whether $CC supports -Wmissing-format-attribute... " >&6; }
40774137
if test "${pgac_cv_prog_cc_cflags__Wmissing_format_attribute+set}" = set; then

‎configure.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ if test "$GCC" = yes -a "$ICC" = no; then
410410
# These work in some but not all gcc versions
411411
PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement])
412412
PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels])
413+
PGAC_PROG_CC_CFLAGS_OPT([-Wlogical-op])
413414
PGAC_PROG_CC_CFLAGS_OPT([-Wmissing-format-attribute])
414415
# This was included in -Wall/-Wformat in older GCC versions
415416
PGAC_PROG_CC_CFLAGS_OPT([-Wformat-security])

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp