lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Undefined tokens in expressions for pre-processing directives are
> replaced with 0 prior to evaluation. There's no reason to give a
> warning here.

I would say that the situation that started this thread is a good reason
to give a warning ;)

I may be missing something, but I cannot see any legitimate use
of this "feature" of the standard except to make expressions with
undefined tokens syntactically correct. If a token can be undefined,
the programmer should protect its use with a 'defined' test.

In gcc, the option -Wundef gives such warning. It does not warn about
syntactical uses of the variable; it only warns when its value is
actually used for something. Things like "#if defined(N) && N > 2"
give no warnings.

-- Roberto