Identification examples: tcc-0.9.27, tcc-0.9.28rc
There are currently warnings such as:
print-802_11.c:3317: warning: assignment discards qualifiers from pointer
target type
print-esp.c:373: warning: function might return no value: 'ldp_pdu_print'
So use: TCPDUMP_TAINTED=yes
Works on linux-amd64.
Does not work on linux-armv7l with BUILD_LIBPCAP=yes / CMAKE=yes
(Segmentation fault, libpcap dynamically linked). Works with 0.9.28rc.
TinyCC can be found at https://bellard.org/tcc/,
https://repo.or.cz/r/tinycc.git or as package on some distros.
# later warnings in the same matrix subset trigger an error.
case `cc_id`/`os_id` in
+tcc-*/*)
+ # print-802_11.c:3317: warning: assignment discards qualifiers from pointer
+ # target type
+ # print-esp.c:373: warning: function might return no value: 'ldp_pdu_print'
+ TCPDUMP_TAINTED=yes
+ ;;
*)
;;
esac
cc_version_nocache() {
: "${CC:?}"
case `basename "$CC"` in
- gcc*|egcc*|clang*)
+ gcc*|egcc*|clang*|tcc*)
# GCC and Clang recognize --version, print to stdout and exit with 0.
"$CC" --version
;;
return
fi
+ # Examples of installed packages:
+ # "tcc version 0.9.27 (x86_64 Linux)"
+ # "tcc version 0.9.27 2023-07-05 mob@5b28165 (x86_64 OpenBSD)"
+ # Example of a development version:
+ # "tcc version 0.9.28rc 2024-04-28 mob@0aca8611 (x86_64 Linux)"
+ cc_id_guessed=`echo "$cc_id_firstline" | sed 's/^.*tcc version \([0-9\.rc]*\).*$/tcc-\1/'`
+ if [ "$cc_id_firstline" != "$cc_id_guessed" ]; then
+ echo "$cc_id_guessed"
+ return
+ fi
+
# OpenBSD default GCC:
# "gcc (GCC) 4.2.1 20070719"
# RedHat GCC:
# warnings as errors.
cc_werr_cflags() {
case `cc_id` in
- gcc-*|clang-*)
+ gcc-*|clang-*|tcc-*)
echo '-Werror'
;;
xlc-*)