Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For example, C Library declares malloc() as:

Code Block
void *malloc(size_t);

...

further reduces the possibility of error:.

Code Block
bgColor#ccccff
widget *p;

/* ... */

p = MALLOC(widget);     /* OK */
if (p != NULL) {
  p->i = 0;           /* OK */
  p->d = 0.0;         /* OK */
}

...

reduces the chance of error in an allocation expression:.

Code Block
bgColor#ccccff
enum { N = 16 };
widget *p;

/* ... */

p = MALLOC_ARRAY(N, widget);    /* OK */

...