lkml.org 
[lkml]   [2010]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] [PERF] (Userspace Tools) Fix a compilation error with -fstack-protector and -Werror

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

    > On Tue, Oct 19, 2010 at 2:38 AM, Frederic Weisbecker <fweisbec@gmail.com> wrote:
    > > On Tue, Oct 19, 2010 at 02:24:00AM +0300, Brian Gitonga Marete wrote:
    > >> The following patch fixes compilation of the perf user-space tools on,
    > >> for example, gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) . It should not
    > >> break anything else.
    > >
    > >
    > >
    > > Hi,
    > >
    > > What kind of warning have you encountered and why it fixes it?
    > > Can you describe that in your changelog?
    > >
    >
    > Hello Frederic,
    >
    > Some versions of gcc, e.g. gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4), have the
    > (default) minimum size of buffers protected by `-fstack-protector' set to 8. But
    > in perf, there exist much smaller automatic buffers.

    Hm, it's this code:

    /* newtWinChoice should really be accepting const char pointers... */
    char yes[] = "Yes", no[] = "No";
    return newtWinChoice(NULL, yes, no, (char *)msg) == 1;

    I.e. the code is messy and GCC is right to warn about it. Hence it would be somewhat
    bad to actually remove the warning that pointed out some dodgy piece of code.

    Even if marking it const doesnt work due to the external libnewt API, we could at
    least put 'yes' and 'no' into file scope and mark them static?

    Ingo


    \
     
     \ /
      Last update: 2010-10-19 08:43    [W:3.958 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site