Re: Possibly confusing documentation on FFI page w.r.t enum redeclaration?

  • From: Mike Pall <mike-1311@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sat, 16 Nov 2013 18:30:16 +0100

demetri wrote:
> Unless I'm misunderstanding C's grammar (I may
> well be!) the entire text of "enum {identifier list} name" is a declaration.

Well, yes. It's declaring an enum type plus it's declaring one or
more enumeration constants.

> I apologize for what may seem like nit-picking, but several of our team's
> newcomers to LuaJIT have bumped into this so I thought it might be a source
> of wider confusion.

Thank you for the reminder! I've rephrased the paragraph:

  ffi.cdef silently ignores most re-declarations. Note: avoid
  re-declarations which do not conform to C99. The implementation
  will eventually be changed to perform strict checks.

--Mike

Other related posts: