Date: Tue, 17 Jan 2012 12:12:34 -0500 From: Eitan Adler <eadler@freebsd.org> To: John Baldwin <jhb@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival <cperciva@freebsd.org> Subject: Re: svn commit: r230125 - head/sys/kern Message-ID: <CAF6rxgngOduQCn_J2bFkn3ExwWbMkbxNbBvqfsWyf3EkNaGrXw@mail.gmail.com> In-Reply-To: <201201171008.28752.jhb@freebsd.org> References: <201201150709.q0F79Iif067938@svn.freebsd.org> <4F136109.9050004@FreeBSD.org> <4F13621B.1060203@freebsd.org> <201201171008.28752.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jan 17, 2012 at 10:08 AM, John Baldwin <jhb@freebsd.org> wrote: > On Sunday, January 15, 2012 6:32:43 pm Colin Percival wrote: >> On 01/15/12 15:28, John Baldwin wrote: >> > On 1/15/12 2:09 AM, Eitan Adler wrote: >> >> Log: >> >> =C2=A0 =C2=A0- Fix undefined behavior when device_get_name is null >> >> =C2=A0 =C2=A0- Make error message more informative >> > >> > The in-kernel printf(9) always prints "(null)" for %s when the pointer= is NULL, >> > so that wasn't undefined behavior. =C2=A0Printing out the driver name = is a useful >> > change, but the "(unknown)" bits are just noise as it isn't clear that >> > "(unknown)" is substantially better than "(null)". >> >> I think the change from "(null)" to "(unknown)" is useful, since when I = see >> "(null)" printed my immediate thought is "looks like there's a bug I nee= d to >> track down here". > > The entire printf is "there's a bug I need to track down here". =C2=A0(nu= ll) > explicitly tells me that device_get_name() is NULL when looking at the pr= intf > to see what it means. =C2=A0Having it be (unknown) tells me the same exac= t thing, > but only after I've parsed an extra 2-3 lines of code to figure out what > (unknown) stands for. To me seeing "(null)" from the output of printf indicates "There is a bug here, printf should never be given a NULL argument.". However, given that it isn't undefined here, and the objections I've received I will revert this part of the change when I get home. --=20 Eitan Adler Ports committer X11, Bugbusting teams
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF6rxgngOduQCn_J2bFkn3ExwWbMkbxNbBvqfsWyf3EkNaGrXw>