const vs. #define
mateusz at LOSKOT.NET
Thu Oct 19 12:26:36 EDT 2006
Ed McNierney wrote:
> I can't imagine it makes any detectable difference in the generated
If C compiler supports C99 and const qualifier is well supported,
using const than #define should be preferable.
const is language implementation feature, but #define is a preprocessor
const as a langauge feature, is "detectable" by compiler, so it's
faster to find bugs when misused.
I think it's always worth to use compiler for bugs detection
wherever it's possible.
More information about the mapserver-dev