On Mon, 16 Jun 2008, John Peterson wrote:

>> the petsc folks define __gierr and then the gcc people are apparently
>> trying to use this same __gierr variable somewhere (I can't see
>> exactly where at the moment but the error message alludes to it).  I
>> think this is petsc's fault because you are never supposed to use
>> variables starting with double underscore .

Yes; I think it's actually in the C and C++ standards that variables
beginning with __ are reserved for the compiler/implementation.

Your "include the C++ headers before PETSc headers" workaround seems
to be good enough for us for now, but I'll point the problem out to
the PETSc bug report address.  It shouldn't be too hard for them to
switch to "petsc_gierr" or some such symbol with less potential for
naming conflicts.

> /usr/include/c++/4.1.2/tr1/functional_iterate.h, line 398:
>
> _Placeholder<_GLIBCXX_NUM_ARGS> _GLIBCXX_JOIN(_,_GLIBCXX_NUM_ARGS);
>
> They actually use a single underscore as an argument to _GLIBCXX_JOIN,
> whatever that is.  Now look again at petscerror.h, line 262:
>
> #define _   __gierr =
>
> They are actually redefining "underscore."  I have no clue why but
> that can't be good programming practice.

I don't think this one is actually prohibited by the language
standards, but that's probably just because they didn't want to tie
the hands of the International Obfuscated C Code Contest.
---
Roy

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to