From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5BD17385E019; Thu, 5 Nov 2020 09:21:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5BD17385E019 From: "tbaeder at redhat dot com" To: systemtap@sourceware.org Subject: [Bug server/26839] Systemtap build failures with clang Date: Thu, 05 Nov 2020 09:21:37 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: server X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tbaeder at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Nov 2020 09:21:37 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26839 --- Comment #3 from Timm B=C3=A4der --- Thanks for the reply, I'll work on this. I changed the labs() line to: unsigned min_score =3D abs(static_cast(target.size()) - static_cast(it->size())); since using the unsigned values generates another error: util.cxx:1545:28: error: call to 'abs' is ambiguous unsigned min_score =3D abs(target.size() - it->size()); ^~~ /usr/include/stdlib.h:840:12: note: candidate function extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; ^ /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/bits/= std_abs.h:56:3: note: candidate function abs(long __i) { return __builtin_labs(__i); } ^ /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/bits/= std_abs.h:61:3: note: candidate function abs(long long __x) { return __builtin_llabs (__x); } ^ /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/bits/= std_abs.h:71:3: note: candidate function abs(double __x) ^ /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/bits/= std_abs.h:75:3: note: candidate function abs(float __x) ^ /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/bits/= std_abs.h:79:3: note: candidate function abs(long double __x) ^ /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/bits/= std_abs.h:85:3: note: candidate function abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >=3D 0 ? __x : -__x; } ^ /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/bits/= std_abs.h:103:3: note: candidate function abs(__float128 __x) ^ After adding the 'override' to emit_function() and emit_probe() in translate.cxx as well as collect_derivation_chain() and collect_derivation_pp_chain() in elaborate.h, I run into a few other issues: 1) set2 in bpf-bitset.h does not return anything from its assignment operat= or but specifies a set2& return value. I fixed this with a 'return *this', but maybe this is just dead code and should be removed? 2) set1_ref and set1_const_ref have a user-defined copy-assignment operator= but use the implicitly defined copy constructor, which clang warns about: ./bpf-bitset.h:108:19: error: definition of implicit copy constructor f= or 'set1_const_ref' is deprecated because it has a user-declared copy assignme= nt operator [-Werror,-Wdeprecated-copy] set1_const_ref& operator=3D (const set1_const_ref &); // not present ^ ./bpf-bitset.h:256:12: note: in implicit copy constructor for 'bpf::bitset::set1_const_ref' first required here return set1_const_ref(data + w2 * i, w2); Solved this by just defining those missing copy constructors explicitly, e.= g.: + set1_const_ref(const set1_const_ref &o) : data(o.data), words(o.words) {= } After this, I'm looking at clang and gcc handling -Wformat-nonliteral differently. Clang warns about this but gcc does not: common.c:691:20: error: format string is not a string literal [-Werror,-Wformat-nonliteral] vsyslog(LOG_ERR, fmt, va); ^~~ common.c:693:20: error: format string is not a string literal [-Werror,-Wformat-nonliteral] vfprintf(stderr, fmt, va); ^~~ And another time in stapbpf.cxx: stapbpf.cxx:257:20: error: format string is not a string literal [-Werror,-Wformat-nonliteral] vfprintf(stderr, str, va); Not quite sure how to best handle these. Adding a #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" // Code #pragma GCC diagnostic pop block works for clang as well and is also done in e.g. stapbpf/bpfinterp.cxx for other code. What do you think? Other than that, the only problem left is the printsig() stuff from above. --=20 You are receiving this mail because: You are the assignee for the bug.=