gcc 3.4 Compiler warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

I got following warning where I don't expect.
"null argument where non-null required (arg 2)"

I tried to simplify the code so it looks a little bit senseless ... normally this is in a bigger macro where I won't check if size is 0

------------------8<------------------------------------------------
#include <string.h>

#define MY_RET_DEF_SIZ(typ) ( my_ret[typ] )

int main(int argc, char **argv) {
    char * tmp1 = "1234567890";
    static char my_ret[] = { 0, 1, 2, 4, 4, 8, 16, 32, 80, 0 };

memmove(tmp1,0,MY_RET_DEF_SIZ(0));

    return 0;
}

------------------8<------------------------------------------------

It works because MY_RET_DEF_SIZ return 0 and so I think the warning isn't usefull there.
What do you think?


Thx
Christian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux