[splint-discuss] how to satisfy splint on the " global variable" declaration.
jjose at globo.com
Fri Sep 7 09:33:00 PDT 2007
I cant find the way to satisfy splint on the " global variable"
I declare a global on the MAIN file, out of any block.
on another " C" file, were same variable will be used, I declare it
using the " external" keyword before the declaration, but splint don't
like it, as follows
teste_anexo.c(17,18): Variable Daa declared more than once
A function or variable is declared in more than one place. This is not
necessarily a problem, since the declarations are consistent. (Use
doubleXlong_main.c(87,8): Previous declaration of Daa
if I declare it as extern withing the function I get:
teste_anexo.c(25,18): Variable Daa shadows outer declaration
An outer declaration is shadowed by the local declaration. (Use -shadow to
doubleXlong_main.c(87,8): Previous definition of Daa: double
teste_anexo.c(25,22): Declaration using extern inside function scope:
An extern declaration is used inside a function scope. (Use
of course I can inhibit the warnings, but I wonder which is the way
to use "external" correctly and 100% withing the SPLINT criteria??????
thanks in advance
More information about the splint-discuss