tech-userlevel archive

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

fmtcheck() query

I made a change to:

	src/tests/lib/libc/gen: t_fmtcheck.c

  Log Message:
  Correct a couple of broken test cases:
	"%d"  does not take the same args as "%d %s"
	"%%"  does not take the same args as "%llx"
  How did these ever survive any kind of even basic sanity check?

which corrects a failing test case after the recent fmtcheck() updates.

But in hindsight I am wondering if this is really correct (though it
matches what the man page says the function should do).

The broken tests were cases where the "suspect" format string consumes
less args than the standard one, but where the args consumed are all of
the correct types (ie: it will leave some args unused.)

This is a case which could possible be permitted, it should do no harm
to use a user supplies (eg: message catalog) format string which doesn't
use all the args, as long as those it does use are of suitable types.

Since, until the recent changes to fmtcheck() these tests used to pass,
it seems that that was what out old fmtcheck() used to permit, and the
updated one does not.

Which do we want?


Home | Main Index | Thread Index | Old Index