site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com In message <E9F2325F-0685-4F52-873E-962CB3F6CA57@cs.washington.edu>, Steve Chec koway writes:
I was using fmtcheck(3) in some code and I noticed that it choked on any format specifier that includes positional arguments (for lack of a better term).
For example, const char *f1 = "%2$d %1$d"; const char *f2 = "%d %d";
printf(fmtcheck(f1, f2), 1, 2);
will print "1 2" since fmtcheck() cannot tell that they consume the same arguments.
I have no spec for the $ syntax.
It also contains a few bugs such as considering %f and %lf to be different. In fact, it doesn't even recognize %lf.
Er, what's %lf? %f takes a double, %Lf takes a long double. I don't know of any purpose for %lf. ... But of course, that makes your point, because %lf should be treated as taking the same arguments as %f. Even if there's no reason for anyone to be using it. :)
I note in the fmtcheck(3) man page, under BUGS, it says, "The fmtcheck () function does not understand all of the conversions that printf(3) does." I'm not 100% positive yet, but I think that mine does.
Would it be worth filing a bug report with Apple about this?
It would probably be worth filing a bug report with Alan Briggs, who has a specific reason to care whether fmtcheck() is buggy. -s _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
seebs@plethora.net