lua-users home
lua-l archive

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


> Generating an invalid pointer is an ANSI C violation: you may only
> calculate pointers from the start of an array to just behind it.

Unfortunately you are right :(


  When an expression that has integer type is added to or subtracted
  from a pointer, the result has the type of the pointer operand. If
  the pointer operand points to an element of an array object, [...]
  otherwise, the behavior is undefined.

  ISO/IEC 9899:1999 (E), 6.5.6 (page 83)

-- Roberto