From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ww0-f49.google.com ([74.125.82.49]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QbIDQ-0004oc-4D for linux-mtd@lists.infradead.org; Mon, 27 Jun 2011 20:15:29 +0000 Received: by wwf22 with SMTP id 22so3697245wwf.18 for ; Mon, 27 Jun 2011 13:15:23 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1309199247-19248-1-git-send-email-computersforpeace@gmail.com> <1309199247-19248-7-git-send-email-computersforpeace@gmail.com> Date: Mon, 27 Jun 2011 13:15:23 -0700 Message-ID: Subject: Re: [PATCH 06/10] mtd-utils: add common version printing function From: Brian Norris To: Mike Frysinger Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: linux-mtd@lists.infradead.org, Artem Bityutskiy List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, Jun 27, 2011 at 12:51 PM, Mike Frysinger wro= te: > On Mon, Jun 27, 2011 at 14:27, Brian Norris wrote: >> +/* Simple version-printing for utils */ >> +#define common_print_version() \ >> +do { \ >> + =A0 =A0 =A0 fprintf(stderr, PROGRAM_NAME " " VERSION "\n"); \ >> +} while (0) > > this shouldnt go to stderr Yeah, I wasn't too sure on that one. There were several utils that already used stderr, but that doesn't actually make much sense, I guess. > if the string is const, then it could just be puts(). =A0but i wonder if > it shouldnt instead use printf("%s %s\n", PROGRAM_NAME, VERSION) so > that the string that represents PROGRAM_NAME isn't duplicated in the > .rodata section. I'm not sure I know what the exact technical difference would be between the string concatenation version and the '%s' argument version... Brian