pcb

Comment 9 for bug 699146

Revision history for this message
Peter Clifton (pcjc2) wrote :

Regards patches, logically contained patches are nice, but that might include removing a whole class of errors. There should not be any unused variables.. I went through and made sure PCB compile without warnings recently.

With regards __FILE__ etc.. I've seen a nice way to do this. For example:

#define malloc(x) _malloc(x, __FILE__, __FUNCTION__)

Then define a function

void *malloc (size_t size, const char *file, const char *function)
{
  void *ptr = malloc (size);
  if (ptr == NULL) {
    fprintf (stderr, ".... %s %s", file, function);
    abort ();
  }
  return ptr;
}