On Fri, May 26, 2006 at 08:47:15PM +0100, Nick Guenther wrote: > least, it should be) in usage() because the proper form is > fprintf(stderr, "usage: %s [-ks]\n", __progname); where __progname > gets filled in automatically with the name of the program. I don't > know the details of how it works though, does anyone have a link > to an explanation?
I'm not sure about this, but isn't __progname a compiler-specific extension? I usually write a usage function to take a single argument, i.e. usage(const char *progname). When I call usage(), which is always from main(), I just pass in argv[0]. I'm under the impression that argv[0] being set to the name of the program is standard (could be wrong though). MG

