[PATCH v2] Support %m in printf functions

Schwarz, Konrad konrad.schwarz@siemens.com
Thu Jan 12 10:42:00 GMT 2012


> > GLIBC conversion of NULL to "(null)" has delayed detection of a bug
> in
> > code of mine.  I would much prefer %s conversion to dump core, either
> > as a side effect of dereferencing NULL or by call of abort().
> 
> Strange.  It had already helped me a lot since it doesn't just crash at
> some point in the C library, but the unexpected string value showed
> pretty clearly what the bug was.

Debuggers have a stack back trace feature which show what arguments user-written code has passed to library routines.  This works for core dumps as well -- though perhaps not for Cygwin.

In this case, the "(null)" was buried in a file destined for machine consumption.




More information about the Newlib mailing list