Ticket #178 (closed bug: fixed)
__FUNCTION__ needs to be fixed
| Reported by: | "Rajeev Thakur" <thakur@…> | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | mpich2 | Keywords: | |
| Cc: |
Description
Adding to Trac.
From: owner-mpich2-core@… owner-mpich2-core@… On Behalf Of Dave Goodell Sent: Wednesday, October 01, 2008 8:19 AM To: mpich2-core@… Subject: Re: [mpich2-core] Fwd: [mpich2-maint] #172: multiple definition?
On Oct 1, 2008, at 7:57 AM, Robert Latham wrote:
On Tue, Sep 30, 2008 at 10:13:09PM -0500, William Gropp wrote:
I don't believe FUNCTION is part of the C language; it may be a nonportable gnuism . All instances should be removed before the release. In the MPICH2 code, we define FUNCNAME and FCNAME to provide portable access to the function name.
FUNCTION appears to be supported in a few compilers, but yes, it's not a standard. 'func' is C99 (6.4.2.2 Predefined identifiers). Is that too new for some of the platforms we wish to support?
Sadly it probably is. We have generally been targeting C89 with a few common bugs as our least common denominator. At this stage it's probably a lot safer to assume more of C99 than it was when the project started. However some of the compilers like the Sun compiler and the PGI compilers are broken in various ways wrt C99. If we didn't have the FUNCTION and FCNAME macros already then I'd say that we should just work around it via configure tests and some preprocessor tricks so that func or FUNCTION was just "" on the few broken compilers. But we do have the other macros and that's probably the right route to take here.
-Dave
