Menu

#2 Cast NULL in void * in functions using va_arg

closed-accepted
nobody
None
5
2010-10-11
2010-10-10
No

NULL isn't necessary a zero value. For instance, on AMD64 architecture, a null pointer is 0x7fff00000000. Usually things works automagically as the compiler always cast NULL and 0 in void * if stored in a pointer variable. But with functions with variable number of arguments the compiler can't know the type of the arguments and thus don't make the cast. In consequences, NULL and 0 must be cast explicitely in void * if the parameter is a pointer.

Discussion

  • Nick Marley

    Nick Marley - 2010-10-11

    1.22 of vformat.c submitted.

     
  • Nick Marley

    Nick Marley - 2010-10-11
    • status: open --> closed-accepted
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.