Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
Fix propagation of cc_werr_cflags() output. [skip ci]
Browse files Browse the repository at this point in the history
Same as in libpcap.  It is not the propagation that tcpdump needs from
this change, but the proper application of compiler options.

(cherry picked from commit f32255b)
  • Loading branch information
infrastation committed Apr 4, 2024
1 parent fb18228 commit fedd2e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ DayOfTheWeek, Month DD, YYYY / The Tcpdump Group
Do not require vsnprintf().
tests: Use the -tttt option, by default, for the tests.
autoconf, CMake: Get the size of a void * and a time_t.
Fix propagation of cc_werr_cflags() output.
Documentation:
Fixed errors in doc/README.Win32.md.

Expand Down
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1063,9 +1063,13 @@ endif()
# usage: cmake -DEXTRA_CFLAGS='-Wall -Wextra -Werror' ...
#
if(NOT "${EXTRA_CFLAGS}" STREQUAL "")
foreach(_extra_cflag ${EXTRA_CFLAGS})
check_and_add_compiler_option("${_extra_cflag}")
endforeach(_extra_cflag)
# The meaning of EXTRA_CFLAGS is "use the exact specified options, or the
# build risks failing to fail", not "try every specified option, omit those
# that do not work and use the rest". Thus use add_compile_options(), not
# foreach()/check_and_add_compiler_option(). Another reason to do that is
# that the effect lasts in testprogs/ and testprogs/fuzz/.
string(REPLACE " " ";" _extra_cflags_list ${EXTRA_CFLAGS})
add_compile_options(${_extra_cflags_list})
message(STATUS "Added extra compile options (${EXTRA_CFLAGS})")
endif()

Expand Down
5 changes: 4 additions & 1 deletion build_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ cc_werr_cflags() {
echo '-qhalt=w'
;;
suncc-*)
echo '-errwarn=%all'
# GCC and Clang print an identification for every warning, which is
# useful for root cause analysis and bug fixing. Sun C does not do it
# by default, but an additional option makes the style more consistent.
echo '-errwarn=%all -errtags=yes'
;;
esac
}
Expand Down

0 comments on commit fedd2e0

Please sign in to comment.