lkml.org 
[lkml]   [2005]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] Pointer cast warnings in scripts/
    Pierre Ossman writes:
    > GCC 4 checks the signedness of pointer casts and generates a whole bunch
    > of warnings for code in scripts/ (which makes heavy use of signed char
    > strings).
    >
    > This patch adds explicit casts.

    This is way ugly. The _real_ bug is that someone decided to store
    plain text pointers in "signed char*" variables. s/signed char/char/g
    should be a much better fix.

    > Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
    > Index: linux-wbsd/scripts/basic/fixdep.c
    > ===================================================================
    > --- linux-wbsd/scripts/basic/fixdep.c (revision 134)
    > +++ linux-wbsd/scripts/basic/fixdep.c (working copy)
    > @@ -242,7 +242,7 @@
    > continue;
    >
    > found:
    > - use_config(p+7, q-p-7);
    > + use_config((char*)p+7, q-p-7);
    > }
    > }
    >
    > @@ -296,7 +296,7 @@
    > signed char *p;
    > char s[PATH_MAX];
    >
    > - p = strchr(m, ':');
    > + p = (signed char*)strchr((char*)m, ':');

    Clearly this is not the way to do text processing in C.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-06-21 14:27    [W:0.021 / U:60.108 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site