CMake: Use CheckAPI's abort/termoutput with dissectors only
I believe this was the original intention, to use these API restricitons with dissectors only (not that I necessarily agree with that policy either), and through copy-paste and lack of clear guidelines it spread to other parts of the build. Rename the checkAPI groups to make it very clear that this is dissector-only. This doesn't mean, of course, that good programming practices shouldn't be followed everywhere. In particular assertions need to be used properly. Don't use them to catch runtime errors or validate input data. This commit will be followed by another removing the various ugly hacks people have been using to get around the checkAPI hammer.
This commit is contained in:
parent
142cfb03ac
commit
7f105d3981
|
@ -415,7 +415,6 @@ CHECKAPI(
|
|||
NAME
|
||||
epan
|
||||
SWITCHES
|
||||
--group termoutput:10 --summary-group termoutput
|
||||
SOURCES
|
||||
${LIBWIRESHARK_NONGENERATED_FILES}
|
||||
)
|
||||
|
|
|
@ -71,7 +71,6 @@ CHECKAPI(
|
|||
NAME
|
||||
crypt
|
||||
SWITCHES
|
||||
-g termoutput
|
||||
SOURCES
|
||||
${CRYPT_FILES}
|
||||
)
|
||||
|
|
|
@ -97,7 +97,6 @@ CHECKAPI(
|
|||
NAME
|
||||
dfilter
|
||||
SWITCHES
|
||||
-g termoutput
|
||||
SOURCES
|
||||
${DFILTER_NONGENERATED_FILES}
|
||||
# LEX files commented out due to use of malloc, free etc.
|
||||
|
|
|
@ -2084,8 +2084,8 @@ CHECKAPI(
|
|||
NAME
|
||||
dissectors
|
||||
SWITCHES
|
||||
--group abort
|
||||
--group termoutput:5 --summary-group termoutput
|
||||
--group dissectors-prohibited
|
||||
--group dissectors-restricted:5 --summary-group dissectors-restricted
|
||||
--file ${CHECKAPI_FILE_LIST}
|
||||
SOURCES
|
||||
${DISSECTOR_SUPPORT_SRC}
|
||||
|
|
|
@ -66,7 +66,6 @@ CHECKAPI(
|
|||
NAME
|
||||
ftypes
|
||||
SWITCHES
|
||||
-g termoutput
|
||||
SOURCES
|
||||
${FTYPE_FILES}
|
||||
)
|
||||
|
|
|
@ -99,7 +99,6 @@ CHECKAPI(
|
|||
NAME
|
||||
wmem
|
||||
SWITCHES
|
||||
--group termoutput:1 --summary-group termoutput
|
||||
SOURCES
|
||||
${WMEM_FILES}
|
||||
)
|
||||
|
|
|
@ -158,7 +158,6 @@ CHECKAPI(
|
|||
NAME
|
||||
wslua
|
||||
SWITCHES
|
||||
--group termoutput:6 --summary-group termoutput
|
||||
SOURCES
|
||||
${WSLUA_FILES}
|
||||
)
|
||||
|
|
|
@ -48,7 +48,6 @@ CHECKAPI(
|
|||
NAME
|
||||
g711
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
SOURCES
|
||||
${CODEC_SRC}
|
||||
${CODEC_HEADERS}
|
||||
|
|
|
@ -50,7 +50,6 @@ CHECKAPI(
|
|||
NAME
|
||||
g722
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
SOURCES
|
||||
${CODEC_SRC}
|
||||
${CODEC_HEADERS}
|
||||
|
|
|
@ -50,7 +50,6 @@ CHECKAPI(
|
|||
NAME
|
||||
g726
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
SOURCES
|
||||
${CODEC_SRC}
|
||||
${CODEC_HEADERS}
|
||||
|
|
|
@ -50,7 +50,6 @@ CHECKAPI(
|
|||
NAME
|
||||
g729
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
SOURCES
|
||||
${CODEC_SRC}
|
||||
${CODEC_HEADERS}
|
||||
|
|
|
@ -50,7 +50,6 @@ CHECKAPI(
|
|||
NAME
|
||||
ilbc
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
SOURCES
|
||||
${CODEC_SRC}
|
||||
${CODEC_HEADERS}
|
||||
|
|
|
@ -48,7 +48,6 @@ CHECKAPI(
|
|||
NAME
|
||||
l16mono
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
SOURCES
|
||||
${CODEC_SRC}
|
||||
${CODEC_HEADERS}
|
||||
|
|
|
@ -50,7 +50,6 @@ CHECKAPI(
|
|||
NAME
|
||||
opus
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
SOURCES
|
||||
${CODEC_SRC}
|
||||
${CODEC_HEADERS}
|
||||
|
|
|
@ -50,7 +50,6 @@ CHECKAPI(
|
|||
NAME
|
||||
sbc
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
SOURCES
|
||||
${CODEC_SRC}
|
||||
${CODEC_HEADERS}
|
||||
|
|
|
@ -51,7 +51,8 @@ CHECKAPI(
|
|||
NAME
|
||||
ethercat
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
--group dissectors-prohibited
|
||||
--group dissectors-restricted
|
||||
SOURCES
|
||||
${DISSECTOR_SRC}
|
||||
${DISSECTOR_HEADERS}
|
||||
|
|
|
@ -45,7 +45,8 @@ CHECKAPI(
|
|||
NAME
|
||||
gryphon
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
--group dissectors-prohibited
|
||||
--group dissectors-restricted
|
||||
SOURCES
|
||||
${DISSECTOR_SRC}
|
||||
${DISSECTOR_HEADERS}
|
||||
|
|
|
@ -47,7 +47,8 @@ CHECKAPI(
|
|||
NAME
|
||||
irda
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
--group dissectors-prohibited
|
||||
--group dissectors-restricted
|
||||
SOURCES
|
||||
${DISSECTOR_SRC}
|
||||
${DISSECTOR_HEADERS}
|
||||
|
|
|
@ -61,8 +61,8 @@ CHECKAPI(
|
|||
NAME
|
||||
mate
|
||||
SWITCHES
|
||||
--group abort
|
||||
--group termoutput:1 --summary-group termoutput
|
||||
--group dissectors-prohibited
|
||||
--group dissectors-restricted
|
||||
SOURCES
|
||||
${DISSECTOR_SRC}
|
||||
${DISSECTOR_SUPPORT_SRC}
|
||||
|
|
|
@ -61,7 +61,8 @@ CHECKAPI(
|
|||
NAME
|
||||
opcua
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
--group dissectors-prohibited
|
||||
--group dissectors-restricted
|
||||
SOURCES
|
||||
${DISSECTOR_SRC}
|
||||
${DISSECTOR_SUPPORT_SRC}
|
||||
|
|
|
@ -64,7 +64,8 @@ CHECKAPI(
|
|||
NAME
|
||||
pluginifdemo
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
--group dissectors-prohibited
|
||||
--group dissectors-restricted
|
||||
SOURCES
|
||||
${DISSECTOR_SRC}
|
||||
${DISSECTOR_HEADERS}
|
||||
|
|
|
@ -60,7 +60,8 @@ CHECKAPI(
|
|||
NAME
|
||||
profinet
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
--group dissectors-prohibited
|
||||
--group dissectors-restricted
|
||||
SOURCES
|
||||
${DISSECTOR_SRC}
|
||||
${DISSECTOR_SUPPORT_SRC}
|
||||
|
|
|
@ -43,7 +43,8 @@ CHECKAPI(
|
|||
NAME
|
||||
stats_tree
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
--group dissectors-prohibited
|
||||
--group dissectors-restricted
|
||||
SOURCES
|
||||
${PLUGIN_FILES}
|
||||
${PLUGIN_HEADERS}
|
||||
|
|
|
@ -52,8 +52,8 @@ CHECKAPI(
|
|||
NAME
|
||||
transum
|
||||
SWITCHES
|
||||
--group abort
|
||||
--group termoutput:1 --summary-group termoutput
|
||||
--group dissectors-prohibited
|
||||
--group dissectors-restricted
|
||||
SOURCES
|
||||
${DISSECTOR_SRC}
|
||||
${DISSECTOR_SUPPORT_SRC}
|
||||
|
|
|
@ -45,7 +45,8 @@ CHECKAPI(
|
|||
NAME
|
||||
unistim
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
--group dissectors-prohibited
|
||||
--group dissectors-restricted
|
||||
SOURCES
|
||||
${DISSECTOR_SRC}
|
||||
${DISSECTOR_HEADERS}
|
||||
|
|
|
@ -92,7 +92,8 @@ CHECKAPI(
|
|||
NAME
|
||||
wimax
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
--group dissectors-prohibited
|
||||
--group dissectors-restricted
|
||||
SOURCES
|
||||
${DISSECTOR_SRC}
|
||||
${DISSECTOR_SUPPORT_SRC}
|
||||
|
|
|
@ -49,7 +49,8 @@ CHECKAPI(
|
|||
NAME
|
||||
wimaxasncp
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
--group dissectors-prohibited
|
||||
--group dissectors-restricted
|
||||
SOURCES
|
||||
${DISSECTOR_SRC}
|
||||
${DISSECTOR_HEADERS}
|
||||
|
|
|
@ -45,7 +45,8 @@ CHECKAPI(
|
|||
NAME
|
||||
wimaxmacphy
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
--group dissectors-prohibited
|
||||
--group dissectors-restricted
|
||||
SOURCES
|
||||
${DISSECTOR_SRC}
|
||||
${DISSECTOR_HEADERS}
|
||||
|
|
|
@ -48,7 +48,6 @@ CHECKAPI(
|
|||
NAME
|
||||
usbdump
|
||||
SWITCHES
|
||||
-g abort -g termoutput
|
||||
SOURCES
|
||||
${WIRETAP_SRC}
|
||||
${WIRETAP_HEADERS}
|
||||
|
|
|
@ -272,8 +272,8 @@ my %APIs = (
|
|||
'qVariantFromValue'
|
||||
] },
|
||||
|
||||
# APIs that make the program exit. Dissectors shouldn't call these
|
||||
'abort' => { 'count_errors' => 1, 'functions' => [
|
||||
'dissectors-prohibited' => { 'count_errors' => 1, 'functions' => [
|
||||
# APIs that make the program exit. Dissectors shouldn't call these.
|
||||
'abort',
|
||||
'assert',
|
||||
'assert_perror',
|
||||
|
@ -282,8 +282,9 @@ my %APIs = (
|
|||
'g_error',
|
||||
] },
|
||||
|
||||
# APIs that print to the terminal. Dissectors shouldn't call these
|
||||
'termoutput' => { 'count_errors' => 0, 'functions' => [
|
||||
'dissectors-restricted' => { 'count_errors' => 0, 'functions' => [
|
||||
# APIs that print to the terminal. Dissectors shouldn't call these.
|
||||
# FIXME: Explain what to use instead.
|
||||
'printf',
|
||||
'g_warning',
|
||||
] },
|
||||
|
|
|
@ -202,8 +202,6 @@ CHECKAPI(
|
|||
NAME
|
||||
wiretap
|
||||
SWITCHES
|
||||
--group abort:11 --summary-group abort
|
||||
--group termoutput:1 --summary-group termoutput
|
||||
SOURCES
|
||||
${WIRETAP_NONGENERATED_FILES}
|
||||
# LEX files commented out due to use of malloc, free etc.
|
||||
|
|
|
@ -291,7 +291,6 @@ CHECKAPI(
|
|||
NAME
|
||||
wsutil
|
||||
SWITCHES
|
||||
--group termoutput:2 --summary-group termoutput
|
||||
SOURCES
|
||||
${WSUTIL_COMMON_FILES}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue