bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

modules and program name


From: Eric Blake
Subject: modules and program name
Date: Thu, 08 Dec 2005 15:28:14 +0000

I noticed when compiling tar on cygwin that I got a warning:
if gcc -DHAVE_CONFIG_H -DLIBDIR=\"/usr/local/lib\" -I. -I. -I..     -g2 -Wall 
-Werror -MT argp-help.o -MD -MP -MF ".deps/argp-help.Tpo" -c -o argp-help.o 
argp-help.c; \
then mv -f ".deps/argp-help.Tpo" ".deps/argp-help.Po"; else rm -f 
".deps/argp-help.Tpo"; exit 1; fi
argp-help.c:1693:4: #warning No reasonable value to return

Further looking at the argp-help module shows that tries using
strrchr(program_invocation_name, '/') which is not portable
to platforms with \ as a directory separator (it would be better
to use the dirname module).  Furthermore, since the warning
comes during the fallback when program_invocation_name
does not exist, it would probably be wise to change argp-help
to use program_name in the same way that the error module
does.

I also noticed that progname.c also does strrchr(argv0, '/'),
another candidate for using the dirname module.

--
Eric Blake




reply via email to

[Prev in Thread] Current Thread [Next in Thread]