[PATCH 06/10] mtd-utils: add common version printing function

Mike Frysinger vapier.adi at gmail.com
Mon Jun 27 15:51:44 EDT 2011


On Mon, Jun 27, 2011 at 14:27, Brian Norris wrote:
> +/* Simple version-printing for utils */
> +#define common_print_version() \
> +do { \
> +       fprintf(stderr, PROGRAM_NAME " " VERSION "\n"); \
> +} while (0)

this shouldnt go to stderr

if the string is const, then it could just be puts().  but 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.
-mike



More information about the linux-mtd mailing list