lua-users home
lua-l archive

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

On 1/2/2015 5:36 AM, Luiz Henrique de Figueiredo wrote:
Lua 5.3.0 (rc3) is now available for testing at

MD5	5dd17d29fbb70139d315e2cea751a128  -
SHA1	83e26c3c21abe7c309c5e9df08b6a7a7db85ef2a  -

This is a release candidate for the final release of Lua 5.3.0.

All feedback welcome. Thanks.

Compiles nicely on Solaris.  Thanks!

It builds without warnings with gcc 4.8.1 and Solaris Studio 12.3. The gcc included with Solaris 10 (gcc 3.4.3) complains about a visibility attribute not being supported, and about luaD_throw in ldo.c being a noreturn function that does return (neither of those warnings is new to RC3). (The visibility attribute warnings can be silenced using the existing configurable parameter LUAI_FUNC in luaconf.h.)

To get support for hexadecimal floating point constants when using gcc on Solaris it seems to be necessary to link to values-xpg6.o. The Solaris Studio compilers include it automatically in c99 mode, but gcc doesn't (yet?). If I understand correctly, explicitly linking values-xpg6.o in a library can cause surprising behavior if the application using the library didn't expect to suddenly get c99 behaviors. So Lua itself probably shouldn't link to values-xpg6.o, but if there is a section in the readme or other documentation for platform specific notes, maybe it could be mentioned there.

For more information about values-xpg6.o, there is a gcc bug:

    -std=c99 does not enable c99 mode in Solaris C library

A couple mailing list discussions:

    -xc99=all and libraries on Solaris 10

    Re: -xc99=all and libraries on Solaris 10

And the Open Solaris source code:

So, anyway... I built Lua, linked with values-xpg6.o, and ran the test suite with "_U=true". All of the tests except two completed successfully. The two failing tests were lines 285 and 295 of files.lua, which try to read from a write only file; I traced the failure down to Solaris not setting ferror():

    #include <stdio.h>
    #include <errno.h>

    int main (int argc, char *argv[]) {
            int c, e;
            FILE *f;

            f = fopen ("/tmp/z", "w");
            if (f == NULL) {
                    perror ("fopen");
                    return 1;
            clearerr (f);
            errno = 0;
            c = getc (f);
            e = errno;
            printf ("c = %d\n", c);
            printf ("errno = %d\n", e);
            printf ("ferror(f) = %d\n", ferror(f));
            printf ("feof(f) == %d\n", feof(f));
            fclose (f);
            return 0;

On Solaris:

    c = -1
    errno = 9
    ferror(f) = 0
    feof(f) == 0

On Linux and OpenBSD:

    c = -1
    errno = 9
    ferror(f) = 1
    feof(f) == 0

Oh well, an operating system anomaly but not an issue with Lua itself.

In summary: looks good on Solaris.  Thanks.

Edward Berner