Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: CVS commit: src/sbin/amrctl



> What's wrong with printf("%s", NULL)? It produces '(null)', and at
> least it's visible something is missing there. I think gcc 9.3 is
> overly eager for this.

our libc "(null)" is beyond standard, and while useful,
the current result is UB from a standards POV.

it's a nice thing in that broken code doesn't crash and
you get a maybe OK result, but it's still bad code to
rely upon this -- it indicates an assertable condition
to me.

> Is it correct to just omit the parameter altogether and change output format

perhaps.  do you have a better idea?  "-"?

thanks.


.mrg.

> Jaromir
> 
> Le dim. 6 sept. 2020 =C3=A0 04:41, matthew green <mrg%netbsd.org@localhost>
> >
> > Module Name:    src
> > Committed By:   mrg
> > Date:           Sun Sep  6 02:34:03 UTC 2020
> >
> > Modified Files:
> >         src/sbin/amrctl: amrctl.c
> >
> > Log Message:
> > avoid calling printf() %s with NULL.
> >
> >
> > To generate a diff of this commit:
> > cvs rdiff -u -r1.11 -r1.12 src/sbin/amrctl/amrctl.c
> >
> > Please note that diffs are not public domain; they are subject to the
> > copyright notices on the relevant files.
> >
> 


Home | Main Index | Thread Index | Old Index