[petsc-users] __FUNCT__ does not agree with __FUNCTION__

Matthew Knepley knepley at gmail.com
Tue Jul 8 20:27:24 CDT 2014


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
>> >
>>
>>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140709/81570f4f/attachment.html>


More information about the petsc-users mailing list