Subject: Re: port-xen/29887: sysctl kern.consdev coredumps
To: None <email@example.com, firstname.lastname@example.org,>
From: Christos Zoulas <email@example.com>
Date: 06/17/2005 09:31:33
On Jun 17, 12:35pm, firstname.lastname@example.org (Martin Husemann) wrote:
-- Subject: Re: port-xen/29887: sysctl kern.consdev coredumps
| > i'd say the proper fix is:
| > - change the callers of printf not to expect printf("%s\n", NULL) work.
| > - and disable the optimization in gcc.
| I'd say the former is enough. Historical practise or not, good code should
| not rely on NULL pointers passed to printf to work. Maybe a note in the man
| page, explaining the historical practice and the depreciation.
| Neither gcc nor printf need to be changed, if we fix all callers.
No, this is not enough. You also need to fix all fprintf(fp, "%s", NULL);
which get converted to fputs(NULL, fp); Where does this stop? How can
you make sure that new code works? This is why you either need to fix the
compiler or the library or both.