Closed bueler closed 8 years ago
After reading up at https://en.wikipedia.org/wiki/Static_(keyword), I will keep the static
keyword.
Note all PETSc example codes use it for the help
string, at the same scope. Indeed the issue is scope, as pointed out by @ckhroulev. That is, the wiki says
Other uses ... Static global variable: A variable declared as static at the top level of a source file (outside any function definitions) is only visible throughout that file ("file scope", also known as "internal linkage").
Regarding initialization: according to the C language standard, section 6.7.9
All the expressions in an initializer for an object that has static or thread storage duration shall be constant expressions or string literals.
And according to section 6.6 of the same document
Constant expressions shall not contain assignment, increment, decrement, function-call, or comma operators, except when they are contained within a subexpression that is not evaluated.
Yes, all clear. I will fix the issue here, but I will also keep the static
keyword because it is harmless here.
Constantine reports
plap.c
does not compile in clang. Problem is in these lines inplap.c
:Two changes here, and in similar: remove
sqrt()
function call, and (minor) irrelevantstatic
, which I do not want to explain anyway.