lua-users home
lua-l archive

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


dolfi <dolfi@zkm.de> wrote:
> > 
> > The code is
> > 
> >   exit(luaL_opt_int(L, 1, EXIT_SUCCESS));
> >   return 0;  /* to avoid warnings */
> > 
> 
> I tried
> 
> return exit(luaL_opt_int(L, 1, EXIT_SUCCESS)), 0;
> 
> with gcc, and it doesn't warn. Somebody wants to try it with other 
> compilers?

The clever construct 

  return exit(luaL_opt_int(L, 1, EXIT_SUCCESS)), 0;

works fine with the Borland C++ 5.5.1. What Borland squeaks about are unreachable "break" statements (ldebug.c 437, 442; liolib 284; lvm.c 534). The linker croaked when trying to resolve "_luaP_opnames" which is unconditionally declared "extern" in lopcodes.h, but conditionally (LUA_OPNAMES must be defined) in lopcodes.c. The authors need to wrap the header file declaration in the same condition block. Of course, defining LUA_OPNAMES works as well.

Kurt Jung
kurt.jung@michigancat.com