[petsc-users] __FUNCT__ does not agree with __FUNCTION__
Satish Balay
balay at mcs.anl.gov
Tue Jul 8 21:58:31 CDT 2014
One can skip __FUNCT__ alltogether in user sourcefiles [assuming you
have a c99 compiler] - as __func__ would automatically be used
by the petsc macros [in includes]
Satish
On Tue, 8 Jul 2014, Matthew Knepley wrote:
> On Wed, Jul 9, 2014 at 3:18 AM, Andrew Cramer <andrewdalecramer at gmail.com>
> wrote:
>
> > Rather than maintain them manually one option is to put
> >
> > #undef __FUNCT__
> > #define __FUNCT__ __func__
> >
> > at the head of your source files which handles any namespace mangling and
> > ensures that you will always be correct. __func__ is standard for C99 and
> > well supported.
> >
>
> We cannot count on C99. For example, it is not support by MS.
>
> Matt
>
>
> >
> > On 9 July 2014 01:07, Satish Balay <balay at mcs.anl.gov> wrote:
> >
> >> On Tue, 8 Jul 2014, Dominik Szczerba wrote:
> >>
> >> > Suddenly (with no apparent change in the code) I am bombarded with
> >> messages
> >> > like:
> >> >
> >> > ScalarSolver\ScalarSolver.x\ScalarSolver.cpp:660:
> >> > __FUNCT__="SetupStiffnessMatrix" does not agree with
> >> > __FUNCTION__="ScalarSolver::SetupStiffnessMatrix"
> >> >
> >> "unknowndirectory/"..\..\..\Source\ScalarSolver\ScalarSolver.x\ScalarSolver.cpp:660:
> >>
> >> Use __FUNCT__="ScalarSolver::SetupStiffnessMatrix" ?
> >>
> >> __FUNCTION__ is automatically generated by some compilers - but we are
> >> still keeping __FUNCT__ arround - just to support compilers that dont
> >> do this automatically.
> >>
> >> And with compilers that do generate __FUNCTION__ string automatically -
> >> we are able
> >> to do this check and print a warning..
> >>
> >> Satish
> >>
> >>
> >> > __FUNCT__="SetupStiffnessMatrix" does not agree with
> >> > __FUNCTION__="ScalarSolver::SetupStiffnessMatrix"
> >> >
> >> "unknowndirectory/"..\..\..\Source\ScalarSolver\ScalarSolver.x\ScalarSolver.cpp:660:
> >> > __FUNCT__="SetupStiffnessMatrix" does not agree with
> >> > __FUNCTION__="ScalarSolver::SetupStiffnessMatrix"
> >> >
> >> "unknowndirectory/"..\..\..\Source\ScalarSolver\ScalarSolver.x\ScalarSolver.cpp:660:
> >> > __FUNCT__="SetupStiffnessMatrix" does not agree with
> >> > __FUNCTION__="ScalarSolver::SetupStiffnessMatrix"
> >> >
> >> >
> >> > Can you please advise how to fix it?
> >> >
> >> > Many thanks
> >> > Dominik
> >> >
> >>
> >>
> >
>
>
>
More information about the petsc-users
mailing list