On Thursday 15 May 2008 23:53, Michel Arboi wrote: > On Thu, May 15, 2008 at 11:30 PM, Thomas Reinke <[EMAIL PROTECTED]> wrote: > > Variables in a function in NASL do not _need_ to be declared. > > Isn't it magical?
I guess it is more a conceptual element of the NASL programming language. Its not a new concept (many other programming languages behave similar), so I wouldn't exactly call it "magic". > > If the variable is not declared at all, it will be created, > > automatically, with a global scope. > > Or maybe not? Who knows? Are you saying that Thomas is wrong? > > 1) Change the nasl "compiler" to force all variables to be > > explictly declared; > > Which is, as far as I can remember, incredibly easy. I guess so, too. > > 2) Default undeclared variables to a local scope; > > That looks like a good idea. I am not sure that automagic is good for this type of programming. Better to make the developer aware of anything that he believed to be implicitly correct. > Maybe I already had it. Are you saying you even implemented this already? Why are you in doubt? > > 3) Have a "lint" style checker that examined functions and > > warned of global variable usage, which could then be vetted > > as acceptable (or not) > > Which is probably not very complicated. I guess it is a simple as option one, in fact it is more or less identical ;-) Best Jan -- Dr. Jan-Oliver Wagner Intevation GmbH Amtsgericht Osnabrück, HR B 18998 http://www.intevation.de/ Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner _______________________________________________ Openvas-discuss mailing list Openvas-discuss@wald.intevation.org http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss