mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Brian Gitonga Marete <marete@toshnix.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH] [PERF] (Userspace Tools) Fix a compilation error with -fstack-protector and -Werror
Date: Tue, 19 Oct 2010 13:49:04 +0200	[thread overview]
Message-ID: <20101019114904.GB25371@elte.hu> (raw)
In-Reply-To: <AANLkTin=0N0b=wK8974RGwXuTxpQ4BtH4bHwjsea+1tS@mail.gmail.com>


* Brian Gitonga Marete <marete@toshnix.com> wrote:

> > OK. Now that I actually look closely at that fragment I can see its useless to 
> > create the automatic arrays. Local string literals would also work (i.e. just 
> > pass `"Yes"' and `"No"' to newtWinChoice). But can also do what you suggested if 
> > it is anticipated that they will be used somewhere else within the file at some 
> > other time -- Currently they are not.
> 
> Oops. Sorry. What I suggested won't work because of the -Wwrite-strings default 
> option. Which actually makes me understand why the original author of the code 
> made it the way it is. Your suggestion of file-scope, static does solve the 
> problem.

Btw., -Wwrite-strings has proven to be a really useful warning in practice, in that 
it ensured that we propagate string immutability/const-ness as widely as possible. 
This resulted is cleaner perf code in the long run.

Here we cannot fix the Newt prototype (it's an existing library outside of our 
control) to take a const so we have to do the (mild) workaround of moving it to file 
scope. (if this becomes common then we'd have to re-evaluate the use of this 
warning)

I think Arnaldo has plans to get rid of the libnewt dependency altogether - that 
might be a fix too.

Thanks,

	Ingo

  parent reply	other threads:[~2010-10-19 11:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-18 23:24 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 [this message]
2010-10-19 13:11             ` Arnaldo Carvalho de Melo
2010-10-24 21:23               ` [PATCH] Fix a compile error with -fstack-protector, -Wstack-protector " Brian Gitonga Marete
2010-11-11 10:25               ` [PATCH] [PERF] (Userspace Tools) Fix a compilation error with -fstack-protector " 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=20101019114904.GB25371@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marete@toshnix.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

all inboxes | Powered by JetHome®