[petsc-users] __FUNCT__ does not agree with __FUNCTION__

Andrew Cramer andrewdalecramer at gmail.com
Tue Jul 8 20:18:56 CDT 2014


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.




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
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140709/5ef69afc/attachment.html>


More information about the petsc-users mailing list