From d434cdd4f7471b8526a44d1d6834f7e3c9c92eb7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 11 Jan 2015 13:28:30 +0300 Subject: Remove from configure warning block maybe-uninitialized. This flag hide some usefull warnings. --- configure | 90 +----------------------------------------------------------- configure.in | 1 - 2 files changed, 1 insertion(+), 90 deletions(-) diff --git a/configure b/configure index 52050b25c..30bf09d4e 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in 2ae9f0c. +# From configure.in 94e07ca. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -5170,94 +5170,6 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" - - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" - - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-maybe-uninitialized" >&5 -$as_echo_n "checking whether $CC supports -Wno-maybe-uninitialized... " >&6; } - OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror -Wno-maybe-uninitialized" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - # Recent versions of gcc don't fail if -Wno-foo is not recognized - # (unless there are also other warnings), so we also check for -Wfoo - # which always fails if not supported - CFLAGS="$OLD_CFLAGS -Werror -Wmaybe-uninitialized" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - CFLAGS="$OLD_CFLAGS -Wno-maybe-uninitialized" - # Optionally, run a test - if test "x" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-maybe-uninitialized" >&5 -$as_echo_n "checking whether $CC can actually use -Wno-maybe-uninitialized... " >&6; } - CFLAGS="$OLD_CFLAGS -Werror -Wmaybe-uninitialized" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not needed but enabled" >&5 -$as_echo "not needed but enabled" >&6; } - CFLAGS="$OLD_CFLAGS" - -else - - CFLAGS="$OLD_CFLAGS -Werror -Wno-maybe-uninitialized" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - CFLAGS="$OLD_CFLAGS -Wno-maybe-uninitialized" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" - - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi diff --git a/configure.in b/configure.in index ec3b1f735..685e256cb 100644 --- a/configure.in +++ b/configure.in @@ -748,7 +748,6 @@ AC_DEFUN(AC_CHECK_COMPILER_WNOFLAG, ) AC_CHECK_COMPILER_WNOFLAG(unused-parameter, [int foo(int bar) { return 0; }]) -AC_CHECK_COMPILER_WNOFLAG(maybe-uninitialized) AC_CHECK_COMPILER_WNOFLAG(clobbered) AC_CHECK_COMPILER_WFLAG(empty-body) AC_CHECK_COMPILER_WFLAG(newline-eof) -- cgit v1.2.3-60-g2f50 From d08d502d325b8dfbd344ab5a657216112beb9944 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 11 Jan 2015 13:31:16 +0300 Subject: Fix uninitialized warning in skill.c. --- src/map/skill.c | 4 ++-- src/map/skill.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/map/skill.c b/src/map/skill.c index 28acb0b7f..53be5541c 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -3382,7 +3382,7 @@ int skill_timerskill(int tid, int64 tick, int id, intptr_t data) { skill->get_type(skl->skill_id),src,src,skl->skill_id,skl->skill_lv,tick,skl->flag,BCT_ENEMY); break; default: - skill->timerskill_notarget_unknown(tid, tick, src, target, ud, skl); + skill->timerskill_notarget_unknown(tid, tick, src, ud, skl); break; } } @@ -3402,7 +3402,7 @@ void skill_timerskill_target_unknown(int tid, int64 tick, struct block_list *src skill->attack(skl->type, src, src, target, skl->skill_id, skl->skill_lv, tick, skl->flag); } -void skill_timerskill_notarget_unknown(int tid, int64 tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl) +void skill_timerskill_notarget_unknown(int tid, int64 tick, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl) { } diff --git a/src/map/skill.h b/src/map/skill.h index aadda32d9..31a268971 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -2055,7 +2055,7 @@ struct skill_interface { void (*attack_post_unknown) (int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag); bool (*timerskill_dead_unknown) (struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl); void (*timerskill_target_unknown) (int tid, int64 tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl); - void (*timerskill_notarget_unknown) (int tid, int64 tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl); + void (*timerskill_notarget_unknown) (int tid, int64 tick, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl); bool (*cleartimerskill_exception) (int skill_id); bool (*castend_id_unknown) (struct unit_data *ud, struct block_list *src, struct block_list *target); bool (*castend_nodamage_id_dead_unknown) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag); -- cgit v1.2.3-60-g2f50 From d4345a95adf365bd224061c190e0ccf85cf3c029 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 11 Jan 2015 13:32:13 +0300 Subject: Update HPM hooks. --- src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 349e11155..28108eea6 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -63811,14 +63811,14 @@ void HP_skill_timerskill_target_unknown(int tid, int64 tick, struct block_list * } return; } -void HP_skill_timerskill_notarget_unknown(int tid, int64 tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl) { +void HP_skill_timerskill_notarget_unknown(int tid, int64 tick, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl) { int hIndex = 0; if( HPMHooks.count.HP_skill_timerskill_notarget_unknown_pre ) { - void (*preHookFunc) (int *tid, int64 *tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl); + void (*preHookFunc) (int *tid, int64 *tick, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_notarget_unknown_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_skill_timerskill_notarget_unknown_pre[hIndex].func; - preHookFunc(&tid, &tick, src, target, ud, skl); + preHookFunc(&tid, &tick, src, ud, skl); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -63826,13 +63826,13 @@ void HP_skill_timerskill_notarget_unknown(int tid, int64 tick, struct block_list } } { - HPMHooks.source.skill.timerskill_notarget_unknown(tid, tick, src, target, ud, skl); + HPMHooks.source.skill.timerskill_notarget_unknown(tid, tick, src, ud, skl); } if( HPMHooks.count.HP_skill_timerskill_notarget_unknown_post ) { - void (*postHookFunc) (int *tid, int64 *tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl); + void (*postHookFunc) (int *tid, int64 *tick, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl); for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_notarget_unknown_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_skill_timerskill_notarget_unknown_post[hIndex].func; - postHookFunc(&tid, &tick, src, target, ud, skl); + postHookFunc(&tid, &tick, src, ud, skl); } } return; -- cgit v1.2.3-60-g2f50 From f890d6dd229eb39fe3674258ee054d3e5cf3d185 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 11 Jan 2015 13:40:21 +0300 Subject: Enable warning format-security. It was blocked in configure. --- configure | 135 +++++++++++++++++++++-------------------------------------- configure.in | 4 +- 2 files changed, 50 insertions(+), 89 deletions(-) diff --git a/configure b/configure index 30bf09d4e..0283c46f9 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in 94e07ca. +# From configure.in 35e1da2. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -5627,81 +5627,42 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-switch" >&5 -$as_echo_n "checking whether $CC supports -Wno-switch... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wformat-security" >&5 +$as_echo_n "checking whether $CC supports -Wformat-security... " >&6; } OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror -Wno-switch" + CFLAGS="$CFLAGS -Werror -Wformat-security" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - # Recent versions of gcc don't fail if -Wno-foo is not recognized - # (unless there are also other warnings), so we also check for -Wfoo - # which always fails if not supported - CFLAGS="$OLD_CFLAGS -Werror -Wswitch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - CFLAGS="$OLD_CFLAGS -Wno-switch" - # Optionally, run a test - if test "x" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-switch" >&5 -$as_echo_n "checking whether $CC can actually use -Wno-switch... " >&6; } - CFLAGS="$OLD_CFLAGS -Werror -Wswitch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not needed but enabled" >&5 -$as_echo "not needed but enabled" >&6; } - CFLAGS="$OLD_CFLAGS" - -else - - CFLAGS="$OLD_CFLAGS -Werror -Wno-switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + CFLAGS="$OLD_CFLAGS -Wformat-security" + # Optionally, run a test + if test "x" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wformat-security" >&5 +$as_echo_n "checking whether $CC can actually use -Wformat-security... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wformat-security" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - CFLAGS="$OLD_CFLAGS -Wno-switch" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" - - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - -else + CFLAGS="$OLD_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wformat-security" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi else @@ -5715,10 +5676,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-missing-field-initializers" >&5 -$as_echo_n "checking whether $CC supports -Wno-missing-field-initializers... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-format-nonliteral" >&5 +$as_echo_n "checking whether $CC supports -Wno-format-nonliteral... " >&6; } OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror -Wno-missing-field-initializers" + CFLAGS="$CFLAGS -Werror -Wno-format-nonliteral" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; @@ -5728,7 +5689,7 @@ if ac_fn_c_try_compile "$LINENO"; then : # Recent versions of gcc don't fail if -Wno-foo is not recognized # (unless there are also other warnings), so we also check for -Wfoo # which always fails if not supported - CFLAGS="$OLD_CFLAGS -Werror -Wmissing-field-initializers" + CFLAGS="$OLD_CFLAGS -Werror -Wformat-nonliteral" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; @@ -5737,12 +5698,12 @@ if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - CFLAGS="$OLD_CFLAGS -Wno-missing-field-initializers" + CFLAGS="$OLD_CFLAGS -Wno-format-nonliteral" # Optionally, run a test if test "x" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-missing-field-initializers" >&5 -$as_echo_n "checking whether $CC can actually use -Wno-missing-field-initializers... " >&6; } - CFLAGS="$OLD_CFLAGS -Werror -Wmissing-field-initializers" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-format-nonliteral" >&5 +$as_echo_n "checking whether $CC can actually use -Wno-format-nonliteral... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wformat-nonliteral" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5755,7 +5716,7 @@ $as_echo "not needed but enabled" >&6; } else - CFLAGS="$OLD_CFLAGS -Werror -Wno-missing-field-initializers" + CFLAGS="$OLD_CFLAGS -Werror -Wno-format-nonliteral" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5764,7 +5725,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - CFLAGS="$OLD_CFLAGS -Wno-missing-field-initializers" + CFLAGS="$OLD_CFLAGS -Wno-format-nonliteral" else @@ -5803,10 +5764,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-format-security" >&5 -$as_echo_n "checking whether $CC supports -Wno-format-security... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-switch" >&5 +$as_echo_n "checking whether $CC supports -Wno-switch... " >&6; } OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror -Wno-format-security" + CFLAGS="$CFLAGS -Werror -Wno-switch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; @@ -5816,7 +5777,7 @@ if ac_fn_c_try_compile "$LINENO"; then : # Recent versions of gcc don't fail if -Wno-foo is not recognized # (unless there are also other warnings), so we also check for -Wfoo # which always fails if not supported - CFLAGS="$OLD_CFLAGS -Werror -Wformat-security" + CFLAGS="$OLD_CFLAGS -Werror -Wswitch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; @@ -5825,12 +5786,12 @@ if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - CFLAGS="$OLD_CFLAGS -Wno-format-security" + CFLAGS="$OLD_CFLAGS -Wno-switch" # Optionally, run a test if test "x" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-format-security" >&5 -$as_echo_n "checking whether $CC can actually use -Wno-format-security... " >&6; } - CFLAGS="$OLD_CFLAGS -Werror -Wformat-security" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-switch" >&5 +$as_echo_n "checking whether $CC can actually use -Wno-switch... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wswitch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5843,7 +5804,7 @@ $as_echo "not needed but enabled" >&6; } else - CFLAGS="$OLD_CFLAGS -Werror -Wno-format-security" + CFLAGS="$OLD_CFLAGS -Werror -Wno-switch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5852,7 +5813,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - CFLAGS="$OLD_CFLAGS -Wno-format-security" + CFLAGS="$OLD_CFLAGS -Wno-switch" else @@ -5891,10 +5852,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-format-nonliteral" >&5 -$as_echo_n "checking whether $CC supports -Wno-format-nonliteral... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-missing-field-initializers" >&5 +$as_echo_n "checking whether $CC supports -Wno-missing-field-initializers... " >&6; } OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror -Wno-format-nonliteral" + CFLAGS="$CFLAGS -Werror -Wno-missing-field-initializers" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; @@ -5904,7 +5865,7 @@ if ac_fn_c_try_compile "$LINENO"; then : # Recent versions of gcc don't fail if -Wno-foo is not recognized # (unless there are also other warnings), so we also check for -Wfoo # which always fails if not supported - CFLAGS="$OLD_CFLAGS -Werror -Wformat-nonliteral" + CFLAGS="$OLD_CFLAGS -Werror -Wmissing-field-initializers" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; @@ -5913,12 +5874,12 @@ if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - CFLAGS="$OLD_CFLAGS -Wno-format-nonliteral" + CFLAGS="$OLD_CFLAGS -Wno-missing-field-initializers" # Optionally, run a test if test "x" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-format-nonliteral" >&5 -$as_echo_n "checking whether $CC can actually use -Wno-format-nonliteral... " >&6; } - CFLAGS="$OLD_CFLAGS -Werror -Wformat-nonliteral" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-missing-field-initializers" >&5 +$as_echo_n "checking whether $CC can actually use -Wno-missing-field-initializers... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wmissing-field-initializers" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5931,7 +5892,7 @@ $as_echo "not needed but enabled" >&6; } else - CFLAGS="$OLD_CFLAGS -Werror -Wno-format-nonliteral" + CFLAGS="$OLD_CFLAGS -Werror -Wno-missing-field-initializers" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5940,7 +5901,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - CFLAGS="$OLD_CFLAGS -Wno-format-nonliteral" + CFLAGS="$OLD_CFLAGS -Wno-missing-field-initializers" else diff --git a/configure.in b/configure.in index 685e256cb..1f2001981 100644 --- a/configure.in +++ b/configure.in @@ -756,10 +756,10 @@ AC_CHECK_COMPILER_WFLAG(enum-conversion) AC_CHECK_COMPILER_WFLAG(shorten-64-to-32) AC_CHECK_COMPILER_WFLAG(constant-conversion) AC_CHECK_COMPILER_WFLAG(bool-conversion) +AC_CHECK_COMPILER_WFLAG(format-security) +AC_CHECK_COMPILER_WNOFLAG(format-nonliteral) AC_CHECK_COMPILER_WNOFLAG(switch) AC_CHECK_COMPILER_WNOFLAG(missing-field-initializers) -AC_CHECK_COMPILER_WNOFLAG(format-security) -AC_CHECK_COMPILER_WNOFLAG(format-nonliteral) # Certain versions of gcc make -Wshadow completely useless by making it flood # you with unnecessary warnings -- cgit v1.2.3-60-g2f50 From b64d0a62182800bd1c827b142c490afd94d7ef46 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 11 Jan 2015 13:54:40 +0300 Subject: Fix some compilation warnings with clang 3.6. --- src/common/utils.c | 2 +- src/map/atcommand.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/utils.c b/src/common/utils.c index f4e261222..5688362de 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -198,7 +198,7 @@ void findfile(const char *p, const char *pat, void (func)(const char*)) sprintf(tmppath,"%s%c%s",path, PATHSEP, entry->d_name); // check if the pattern matches. - if (entry->d_name && strstr(entry->d_name, pattern)) { + if (strstr(entry->d_name, pattern)) { func( tmppath ); } // check if it is a directory. diff --git a/src/map/atcommand.c b/src/map/atcommand.c index a78b644a9..56dd5784c 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5979,7 +5979,7 @@ ACMD(mobsearch) clif->message(fd, atcmd_output); return false; } - if(mob_id == atoi(mob_name) && mob->db(mob_id)->jname) + if (mob_id == atoi(mob_name)) strcpy(mob_name,mob->db(mob_id)->jname); // --ja-- //strcpy(mob_name,mob_db(mob_id)->name); // --en-- -- cgit v1.2.3-60-g2f50