linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramkumar Ramachandra <artagnon@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
	Namhyung Kim <namhyung.kim@lge.com>
Subject: [PATCH v2 3/4] perf: squelch warnings from perl.h to compile-pass
Date: Fri,  5 Jul 2013 15:46:16 +0530	[thread overview]
Message-ID: <1373019377-12741-4-git-send-email-artagnon@gmail.com> (raw)
In-Reply-To: <1373019377-12741-1-git-send-email-artagnon@gmail.com>

Currently, a simple

  $ make

errors out because we compile with -Werror by default, turning all
warnings into errors.  Although no warnings are emitted by our code
itself, two kinds of warnings are emitted by perl.h (perl 5.18.0):

  -Wundef and -Wswitch-default

Use #pragma statements to squelch exactly those warnings.  The next
patch will regenerate Context.c from Context.xs and make the compile
pass.

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 tools/perf/scripts/perl/Perf-Trace-Util/Context.xs   |  4 ++--
 tools/perf/util/perf-perl.h                          | 10 ++++++++++
 tools/perf/util/scripting-engines/trace-event-perl.c |  2 +-
 3 files changed, 13 insertions(+), 3 deletions(-)
 create mode 100644 tools/perf/util/perf-perl.h

diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/Context.xs b/tools/perf/scripts/perl/Perf-Trace-Util/Context.xs
index 8c7ea42..509d22e 100644
--- a/tools/perf/scripts/perl/Perf-Trace-Util/Context.xs
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/Context.xs
@@ -19,8 +19,8 @@
  *
  */
 
-#include "EXTERN.h"
-#include "perl.h"
+#include <EXTERN.h>
+#include "../../../util/perf-perl.h"
 #include "XSUB.h"
 #include "../../../perf.h"
 #include "../../../util/trace-event.h"
diff --git a/tools/perf/util/perf-perl.h b/tools/perf/util/perf-perl.h
new file mode 100644
index 0000000..49995d2
--- /dev/null
+++ b/tools/perf/util/perf-perl.h
@@ -0,0 +1,10 @@
+#ifndef __PERF_PERL_H
+#define __PERF_PERL_H
+
+#pragma GCC diagnostic ignored "-Wundef"
+#pragma GCC diagnostic ignored "-Wswitch-default"
+#include <perl.h>
+#pragma GCC diagnostic error "-Wundef"
+#pragma GCC diagnostic error "-Wswitch-default"
+
+#endif
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c
index eacec85..25fd2dc 100644
--- a/tools/perf/util/scripting-engines/trace-event-perl.c
+++ b/tools/perf/util/scripting-engines/trace-event-perl.c
@@ -27,7 +27,7 @@
 
 #include "../util.h"
 #include <EXTERN.h>
-#include <perl.h>
+#include "../perf-perl.h"
 
 #include "../../perf.h"
 #include "../thread.h"
-- 
1.8.3.1.643.gebeea52.dirty


  parent reply	other threads:[~2013-07-05 10:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-05 10:16 [PATCH v2 0/4] Minor perf build fixes Ramkumar Ramachandra
2013-07-05 10:16 ` [PATCH v2 1/4] perf/Makefile: do not open-code shell-sq Ramkumar Ramachandra
2013-07-05 10:16 ` [PATCH v2 2/4] perf/Perf-Trace-Util: fix broken include in Context.xs Ramkumar Ramachandra
2013-07-05 10:16 ` Ramkumar Ramachandra [this message]
2013-07-05 10:16 ` [PATCH v2 4/4] perf/Perf-Trace-Util: regenerate Context.c Ramkumar Ramachandra
2013-07-09  5:22 ` [PATCH v2 0/4] Minor perf build fixes Namhyung Kim
2013-07-09  8:51   ` Ramkumar Ramachandra

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=1373019377-12741-4-git-send-email-artagnon@gmail.com \
    --to=artagnon@gmail.com \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung.kim@lge.com \
    /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 NNTP newsgroup(s).