[splint-discuss] how to satisfy splint on the " global variable" declaration.
juan abba
jjose at globo.com
Fri Sep 7 09:33:00 PDT 2007
hi
I cant find the way to satisfy splint on the " global variable"
declaration.
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
-redecl to
inhibit warning)
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
inhibit warning)
doubleXlong_main.c(87,8): Previous definition of Daa: double
teste_anexo.c(25,22): Declaration using extern inside function scope:
double Daa
An extern declaration is used inside a function scope. (Use
-nestedextern to
inhibit warning)
================================================================
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
juan
More information about the splint-discuss
mailing list