Re: Administrivia: List Announcement

From: Luciano Miguel Ferreira Rocha (strangeat_private-ip.org)
Date: Wed May 14 2003 - 07:45:29 PDT

  • Next message: Michael Wojcik: "FW: partial analysis of vulndev-1.c"

    On Tue, May 13, 2003 at 10:45:21AM -0700, Brian Hatch wrote:
    > And for goodness sake, let's cast things properly if you're going
    > to malloc, and for good form include the size of the element, even
    > when it's a char:
    > 
    > 	char *buf1 = (char*)malloc( SIZE * sizeof(char) );
    No, bad idea.
    
    If malloc isn't defined, the compiler will cast an int to a pointer, which
    may not be the same size.
    
    If malloc is (well) defined, it returns a type of (void *), well casted to
    any pointer by the compiler.
    
    Regards,
    Luciano Rocha
    



    This archive was generated by hypermail 2b30 : Wed May 14 2003 - 09:19:54 PDT