2010-11-11 10:25:43

by Eric Dumazet

[permalink] [raw]
Subject: Re: [PATCH] [PERF] (Userspace Tools) Fix a compilation error with -fstack-protector and -Werror

Le mardi 19 octobre 2010 à 11:11 -0200, Arnaldo Carvalho de Melo a
écrit :
> Em Tue, Oct 19, 2010 at 01:49:04PM +0200, Ingo Molnar escreveu:
> >
> > * Brian Gitonga Marete <[email protected]> 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.
>
> Yeah, but for now I'll just reap the results of this long discussion
> about this issue. :)
>

Hi Arnaldo

Sorry if I missed something, but current linux-2.6 tree has the problem.

Is the fix under control ?

Thanks !


2010-11-11 17:05:46

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH] [PERF] (Userspace Tools) Fix a compilation error with -fstack-protector and -Werror

Em Thu, Nov 11, 2010 at 11:25:35AM +0100, Eric Dumazet escreveu:
> Hi Arnaldo
>
> Sorry if I missed something, but current linux-2.6 tree has the problem.
>
> Is the fix under control ?

Ingo merged this while I'm away, its in tip/urgent.

commit a3da8e451321c31d88cebd12c234d0aac2a1cc35
Author: Cyrill Gorcunov <[email protected]>
Date: Sat Nov 6 11:47:24 2010 +0300

perf, ui: Eliminate stack-smashing protection compiler complaint


- Arnaldo

2010-11-11 17:13:26

by Eric Dumazet

[permalink] [raw]
Subject: Re: [PATCH] [PERF] (Userspace Tools) Fix a compilation error with -fstack-protector and -Werror

Le jeudi 11 novembre 2010 à 12:05 -0500, Arnaldo Carvalho de Melo a
écrit :

> Ingo merged this while I'm away, its in tip/urgent.

So far so good ;)

Thanks !