[lkml]   [2005]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: Not a GCC bug (was Re: Big GCC bug!!! [Was: Re: Do not misuse Coverity please])
    On Mar 30, 2005, at 18:38, Jakub Jelinek wrote:
    > This testcase violates ISO C99
    > If a null pointer constant is converted to a pointer type, the
    > resulting
    > pointer, called a null pointer, is guaranteed to compare unequal to a
    > pointer to any object or function.

    Except that the result of dereferencing a null pointer is implementation
    defined according to the C99 standard. My implementation allows me to
    stuff at NULL, and therefore its compiler should be able to handle that
    case. I would have no problem with either the standard or
    if it either properly handled the case or didn't allow it in the first

    On another note, I've discovered the flag
    which should probably be included in the kernel makefiles to disable
    optimization for the kernel. (Ok, yes, I apologize, this isn't really
    a GCC
    bug, the behavior is documented, although it can be quite confusing. I
    suspect it may bite some platform-specific code someday. It also
    the waters somewhat with respect to the original note (and the effects
    the generated code):

    > int x = my_struct->the_x;
    > if (!my_struct) return;

    Kyle Moffett

    Version: 3.12
    GCM/CS/IT/U d- s++: a18 C++++>$ UB/L/X/*++++(+)>$ P+++(++++)>$
    L++++(+++) E W++(+) N+++(++) o? K? w--- O? M++ V? PS+() PE+(-) Y+
    PGP+++ t+(+++) 5 X R? tv-(--) b++++(++) DI+ D+ G e->++++$ h!*()>++$ r
    ------END GEEK CODE BLOCK------

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-04-06 13:31    [W:0.024 / U:48.204 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site