Subject: Re: port-xen/29887: sysctl kern.consdev coredumps
To: None <firstname.lastname@example.org, email@example.com,>
From: Christos Zoulas <firstname.lastname@example.org>
Date: 06/17/2005 09:31:33
On Jun 17, 12:35pm, email@example.com (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.