From owner-freebsd-hackers Wed Nov 12 11:35:05 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id LAA00715 for hackers-outgoing; Wed, 12 Nov 1997 11:35:05 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from smtp03.primenet.com (smtp03.primenet.com [206.165.5.84]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id LAA00668 for ; Wed, 12 Nov 1997 11:34:45 -0800 (PST) (envelope-from tlambert@usr09.primenet.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.8.7/8.8.7) id MAA28917; Wed, 12 Nov 1997 12:34:41 -0700 (MST) Received: from usr09.primenet.com(206.165.6.209) via SMTP by smtp03.primenet.com, id smtpd028911; Wed Nov 12 12:34:36 1997 Received: (from tlambert@localhost) by usr09.primenet.com (8.8.5/8.8.5) id MAA04831; Wed, 12 Nov 1997 12:34:33 -0700 (MST) From: Terry Lambert Message-Id: <199711121934.MAA04831@usr09.primenet.com> Subject: Re: A stylistic question... To: luigi@labinfo.iet.unipi.it (Luigi Rizzo) Date: Wed, 12 Nov 1997 19:34:33 +0000 (GMT) Cc: adrian@virginia.edu, hackers@FreeBSD.ORG In-Reply-To: <199711121416.PAA07129@labinfo.iet.unipi.it> from "Luigi Rizzo" at Nov 12, 97 03:16:57 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > Why do yo feel that you need the "%s" though? Just make the > > "blah..." your format string. The parsing of the format string is pretty > > efficient. It reads a char and then switch()'s on it to what to do. > > the "%s" was added on the fly while composing the message and not > knowing the details of format string parsing. After your clarification, > then the only possible usefulness is that one must not worry to > escape % chars ... a very weak motivation indeed. Use puts(): it will also aboid the formatting code. Actually use "fputs()" and specify stderr, where usage messages are supposed be sent. The motivation in using "fprintf()" in that case is to specify stderr up front instead if as an after though that people might not reaad to. It's defensible that the stream should be the first, not last, argument to "fputs()". Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.