[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: use of -fno-common on Darwin
From: |
James Youngman |
Subject: |
Re: use of -fno-common on Darwin |
Date: |
Tue, 10 Jan 2006 21:34:28 +0000 |
User-agent: |
Mutt/1.5.9i |
On Tue, Jan 10, 2006 at 11:07:20PM +0900, Peter O'Gorman wrote:
> char *
> get_prog_name(void)
> {
> char * name;
> if (prog_name)
> name = prog_name;
> else
> {
> #if defined(HAVE_GETPROGNAME)
> #include <stdlib.h>
> name = getprogname();
> #elif defined(HAVE_GETEXECNAME)
> #include <stdlib.h>
> name = getexecname();
> #elif defined(HAVE_PROGRAM_INVOCATION_SHORT_NAME)
> #include <errno.h>
> name = program_invocation_short_name;
> #else
> name = "executable";
> #endif
> }
> return name;
> }
If we adopted this code, application authors would still be obliged to
call set_program_name() since there would still be platforms where the
> name = "executable";
clause is executed. However, this clause will only be exercised on
some systems, so having a good default here simply helps to mask bugs.
This is especially unfortunate where developers have a machine which
can figure out the executable name unaided, but end-users don't.
James.
- use of -fno-common on Darwin (was: use of program_name), (continued)
- use of -fno-common on Darwin (was: use of program_name), Ralf Wildenhues, 2006/01/09
- Re: use of -fno-common on Darwin, Peter O'Gorman, 2006/01/09
- Re: use of -fno-common on Darwin, Paul Eggert, 2006/01/09
- Re: use of -fno-common on Darwin, Bob Friesenhahn, 2006/01/10
- Re: use of -fno-common on Darwin, Bruno Haible, 2006/01/10
- Re: use of -fno-common on Darwin, Peter O'Gorman, 2006/01/10
- Re: getprogname, Bruno Haible, 2006/01/10
- Re: getprogname, Paul Eggert, 2006/01/10
- Re: getprogname, Bruno Haible, 2006/01/10
- Re: getprogname, Paul Eggert, 2006/01/11
- Re: use of -fno-common on Darwin,
James Youngman <=
- Re: getprogname, Bruno Haible, 2006/01/11
- Re: getprogname, Paul Eggert, 2006/01/11
- Re: [bug-gnulib] Re: use of program_name, Bruno Haible, 2006/01/09
- Re: use of program_name, James Youngman, 2006/01/05
- Re: [bug-gnulib] Re: use of program_name, Bruno Haible, 2006/01/09
- Re: [bug-gnulib] Re: use of program_name, James Youngman, 2006/01/09
- Re: use of program_name, Dave Love, 2006/01/05
- Re: [bug-gnulib] Re: use of program_name, Bruno Haible, 2006/01/09
- Re: [bug-gnulib] Re: use of program_name, Bruno Haible, 2006/01/09
Re: [bug-gnulib] use of program_name, Bruno Haible, 2006/01/09