public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Tom Stellard <tstellar@redhat.com>
To: systemtap@sourceware.org
Subject: [PATCH 6/8] Fix -Woverloaded-virtual warnings when building with clang
Date: Mon, 30 Nov 2020 19:58:39 +0000	[thread overview]
Message-ID: <20201130195841.26142-7-tstellar@redhat.com> (raw)
In-Reply-To: <20201130195841.26142-1-tstellar@redhat.com>

---
 elaborate.cxx |  8 +++++++-
 elaborate.h   |  3 ++-
 main.cxx      |  2 +-
 tapsets.cxx   | 15 +++++++++------
 4 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/elaborate.cxx b/elaborate.cxx
index b069fb5ba..28cd326d6 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -78,10 +78,16 @@ derived_probe::derived_probe (probe *p, probe_point *l, bool rewrite_loc):
   this->locations.push_back (l);
 }
 
+void
+derived_probe::printsig_nonest (ostream& o) const
+{
+  probe::printsig (o);
+}
 
 void
-derived_probe::printsig (ostream& o, bool nest) const
+derived_probe::printsig (ostream& o) const
 {
+  bool nest = true;
   probe::printsig (o);
 
   if (nest)
diff --git a/elaborate.h b/elaborate.h
index 860068620..935027f40 100644
--- a/elaborate.h
+++ b/elaborate.h
@@ -203,7 +203,8 @@ struct derived_probe: public probe
   virtual void join_group (systemtap_session& s) = 0;
   virtual probe_point* sole_location () const;
   virtual probe_point* script_location () const;
-  virtual void printsig (std::ostream &o, bool nest=true) const;
+  virtual void printsig (std::ostream &o) const override;
+  void printsig_nonest (std::ostream &o) const;
   // return arguments of probe if there
   virtual void getargs (std::list<std::string> &) const {}
   void printsig_nested (std::ostream &o) const;
diff --git a/main.cxx b/main.cxx
index f3a0d9830..b41cb58a6 100644
--- a/main.cxx
+++ b/main.cxx
@@ -177,7 +177,7 @@ printscript(systemtap_session& s, ostream& o)
                     {
                       // We want to print the probe point signature (without the nested components).
                       std::ostringstream sig;
-                      p->printsig(sig, false);
+                      p->printsig_nonest(sig);
 
                       if (s.dump_mode == systemtap_session::dump_matched_probes_vars && isatty(STDOUT_FILENO))
                         o << s.colorize(sig.str(), "source");
diff --git a/tapsets.cxx b/tapsets.cxx
index 52c59fa50..b235e72fd 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -559,7 +559,7 @@ struct dwarf_derived_probe: public generic_kprobe_derived_probe
   interned_string user_lib;
   bool access_vars;
 
-  void printsig (std::ostream &o, bool nest=true) const;
+  void printsig (std::ostream &o) const;
   virtual void join_group (systemtap_session& s);
   void emit_probe_local_init(systemtap_session& s, translator_output * o);
   void getargs(std::list<std::string> &arg_set) const;
@@ -5320,8 +5320,9 @@ dwarf_atvar_expanding_visitor::visit_atvar_op (atvar_op* e)
 
 
 void
-dwarf_derived_probe::printsig (ostream& o, bool nest) const
+dwarf_derived_probe::printsig (ostream& o) const
 {
+  bool nest = true;
   // Instead of just printing the plain locations, we add a PC value
   // as a comment as a way of telling e.g. apart multiple inlined
   // function instances.  This is distinct from the verbose/clog
@@ -10191,7 +10192,7 @@ struct kprobe_derived_probe: public generic_kprobe_derived_probe
   string path;
   string library;
   bool access_var;
-  void printsig (std::ostream &o, bool nest=true) const;
+  void printsig (std::ostream &o) const;
   void join_group (systemtap_session& s);
 };
 
@@ -10320,8 +10321,9 @@ kprobe_derived_probe::kprobe_derived_probe (systemtap_session& sess,
   this->sole_location()->components = comps;
 }
 
-void kprobe_derived_probe::printsig (ostream& o, bool nest) const
+void kprobe_derived_probe::printsig (ostream& o) const
 {
+  bool nest = true;
   sole_location()->print (o);
   o << " /* " << " name = " << symbol_name << "*/";
 
@@ -10553,7 +10555,7 @@ struct hwbkpt_derived_probe: public derived_probe
   string symbol_name;
   unsigned int hwbkpt_access,hwbkpt_len;
 
-  void printsig (std::ostream &o, bool nest) const;
+  void printsig (std::ostream &o) const;
   void join_group (systemtap_session& s);
 };
 
@@ -10620,8 +10622,9 @@ hwbkpt_derived_probe::hwbkpt_derived_probe (probe *base,
   this->sole_location()->components = comps;
 }
 
-void hwbkpt_derived_probe::printsig (ostream& o, bool nest) const
+void hwbkpt_derived_probe::printsig (ostream& o) const
 {
+  bool nest = true;
   sole_location()->print (o);
 
   if (nest)
-- 
2.26.2


  parent reply	other threads:[~2020-11-30 19:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30 19:58 Clang build fixes Tom Stellard
2020-11-30 19:58 ` [PATCH 1/8] Fix a few class/struct mixups Tom Stellard
2020-11-30 19:58 ` [PATCH 2/8] util: Use abs() instead of labs() Tom Stellard
2020-11-30 19:58 ` [PATCH 3/8] Add some override specifiers where missing Tom Stellard
2020-11-30 19:58 ` [PATCH 4/8] Add missing copy constructors to set1_ref and set1_const_ref Tom Stellard
2020-11-30 19:58 ` [PATCH 5/8] set2: Return this from assignment operator Tom Stellard
2020-11-30 19:58 ` Tom Stellard [this message]
2020-11-30 19:58 ` [PATCH 7/8] Fix -Wformat-nonliteral and -Wformat warnings with clang Tom Stellard
2020-11-30 19:58 ` [PATCH 8/8] dtrace: Use -o option to specify output file for CPP Tom Stellard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201130195841.26142-7-tstellar@redhat.com \
    --to=tstellar@redhat.com \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).