bug-gnulib
[Top][All Lists]
Advanced

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

Re: [bug-gnulib] Re: use of program_name


From: Bruno Haible
Subject: Re: [bug-gnulib] Re: use of program_name
Date: Mon, 9 Jan 2006 14:51:04 +0100
User-agent: KMail/1.5

Paul Eggert wrote on 2006-01-06:
> Perhaps we could change progname.h so that 'program_name' is a
> function that returns the program name, instead of being a global
> variable.

Ouch. When things go wrong, this leads to intriguing compiler errors like
"cannot call program_name as a function" or "assignment from function pointer
to data pointer". Or, in case of a mismatch between .o files, just core dumps.

And how would that function return the value of argv[0]? If it needs an
auxiliary '[const] char *' variable, you have not won much: you have pushed
the complexity back from gnulib into the developer's main program.

Bruno





reply via email to

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