[lkml]   [2004]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] Use NULL instead of integer 0 in security/selinux/
    On Jul 09, 2004, at 19:49, Paul Jackson wrote:
    > I suspect not. Up to Linus. This is all about writing code that
    > doesn't bite.
    > Since mostly it's us humans doing the writing, this is more a human
    > engineering problem than a pure mathematics problem such as Dijkstra
    > or Wirth were closer to addressing.
    > Let someone with demonstrated good taste dictate the style choices
    > that lead to short, sweat, but seldom screwy code.
    > It's all arbitrary as hell. The proof is in the pudding.

    The place this probably matters most is in various function calls. For
    example, given the following prototype, (and ignoring the fact that
    gcc is generally able to properly compile all of these), which is the
    most clear? These are all "logically" correct, for the most part, but
    as humans we have certain readability standards.

    int some_function(int a, void *b, char *c, unsigned char d, int e);

    A) int res = some_function(0,0,0,0,0);
    B) int res = some_function(NULL,NULL,NULL,NULL,NULL);
    C) int res = some_function(0,NULL,NULL,'\0',0);

    C is the most expressive of the intent of the code, and the least
    likely to contain bugs.

    Kyle Moffett

    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-03-22 14:04    [W:0.041 / U:6.340 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site