Subject: Re: port-xen/29887: sysctl kern.consdev coredumps
To: None <port-xen-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Christos Zoulas <christos@zoulas.com>
List: netbsd-bugs
Date: 06/17/2005 13:32:01
The following reply was made to PR port-xen/29887; it has been noted by GNATS.

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@netbsd.org, port-xen-maintainer@netbsd.org,
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: port-xen/29887: sysctl kern.consdev coredumps
Date: Fri, 17 Jun 2005 09:31:33 -0400

 On Jun 17, 12:35pm, martin@duskware.de (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.
 
 christos