From: Brian Gitonga Marete <marete@toshnix.com>
To: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Brian Gitonga Marete <marete@toshnix.com>,
Ingo Molnar <mingo@elte.hu>,
Frederic Weisbecker <fweisbec@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [PATCH] Fix a compile error with -fstack-protector, -Wstack-protector and -Werror.
Date: Mon, 25 Oct 2010 00:23:19 +0300 [thread overview]
Message-ID: <1287955399-25354-1-git-send-email-marete@toshnix.com> (raw)
In-Reply-To: <20101019131152.GB3826@ghostprotocols.net>
The following is as per Ingo's suggestion. Agains 2.6.36. Thanks.
In the function ui__dialog_yesno(), automatic buffers have to be used as long
as we are compiling perf with the -Wwrite-stings and -Werror options. This is because the
Newt library does not declare the string parameters in newtWinChoice() as
constant when it should.
But the automatic buffers are not large enough to benefit from ssp at least on some gcc versions, e.g. the one that comes with Ubuntu 9.0.4. This along with -Wstack-protector causes a compile warning which is turned into an error by
-Werror.
This patch works around this problem by making the buffers global and static.
Signed-off-by: Brian Gitonga Marete <marete@toshnix.com>
---
tools/perf/util/ui/util.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/tools/perf/util/ui/util.c b/tools/perf/util/ui/util.c
index 04600e2..c7dc022 100644
--- a/tools/perf/util/ui/util.c
+++ b/tools/perf/util/ui/util.c
@@ -11,6 +11,9 @@
#include "helpline.h"
#include "util.h"
+static char yes[] = "Yes";
+static char no[] = "No";
+
newtComponent newt_form__new(void);
static void newt_form__set_exit_keys(newtComponent self)
@@ -109,6 +112,5 @@ out_destroy_form:
bool ui__dialog_yesno(const char *msg)
{
/* newtWinChoice should really be accepting const char pointers... */
- char yes[] = "Yes", no[] = "No";
return newtWinChoice(NULL, yes, no, (char *)msg) == 1;
}
--
1.7.1.1
next prev parent reply other threads:[~2010-10-24 21:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-18 23:24 [PATCH] [PERF] (Userspace Tools) Fix a compilation error with -fstack-protector " Brian Gitonga Marete
2010-10-18 23:38 ` Frederic Weisbecker
2010-10-19 0:06 ` Brian Gitonga Marete
2010-10-19 0:20 ` Frederic Weisbecker
2010-10-19 6:40 ` Ingo Molnar
2010-10-19 9:03 ` Américo Wang
2010-10-19 11:12 ` Brian Gitonga Marete
2010-10-19 11:33 ` Brian Gitonga Marete
2010-10-19 11:37 ` Brian Gitonga Marete
2010-10-19 11:49 ` Ingo Molnar
2010-10-19 13:11 ` Arnaldo Carvalho de Melo
2010-10-24 21:23 ` Brian Gitonga Marete [this message]
2010-11-11 10:25 ` Eric Dumazet
2010-11-11 17:05 ` Arnaldo Carvalho de Melo
2010-11-11 17:13 ` Eric Dumazet
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=1287955399-25354-1-git-send-email-marete@toshnix.com \
--to=marete@toshnix.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@infradead.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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
all inboxes | Powered by JetHome®