site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com For example, const char *f1 = "%2$d %1$d"; const char *f2 = "%d %d"; printf(fmtcheck(f1, f2), 1, 2); If anyone would care to take a look at what I wrote, the file is http://www.cs.washington.edu/homes/steve/fmtcheck.c Would it be worth filing a bug report with Apple about this? Here is a (far from exhaustive) test file: http://www.cs.washington.edu/homes/steve/fcheck.c - Steve _______________________________________________ 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 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). will print "1 2" since fmtcheck() cannot tell that they consume the same arguments. It also contains a few bugs such as considering %f and %lf to be different. In fact, it doesn't even recognize %lf. This was unacceptable, so I wrote my own based (loosely) upon the fmtcheck.c used in NetBSD written by Allen Briggs in 2000. (This appears to be the same version used in Darwin.) 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. smime.p7s
participants (1)
-
Steve Checkoway