On Solaris 8, if I use a perl5.7.2+ compiled with gcc with all the default
options, and then use that perl to try to build parrot with all its
defaults, I get a fatal error:

gcc -I/usr/local/include -I/opt/gnu/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
 -Wall -ansi -pedantic -Wstrict-prototypes -Wmissing-prototypes -Winline -Wshadow 
-Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion 
-Waggregate-return -Winline -W -Wsign-compare -Wno-unused   -I./include -o test_main.o 
-c test_main.c
test_main.c: In function `main':
test_main.c:211: incompatible types in assignment
test_main.c:219: cast to union type from type not present in union
test_main.c:219: warning: cast increases required alignment of target type
test_main.c:230: warning: passing arg 4 of `PackFile_unpack' as unsigned due to 
prototype
test_main.c:249: warning: declaration of `time' shadows global declaration
*** Error code 1
make: Fatal error: Command failed for target `test_main.o'

The problem appears to be the off_t typdef.  Since perl5's Configure
gave me -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64, off_t is typdef'd
as a union involving long long.

    typedef union {
        double  _d;
        int     _l[2];
    } __longlong_t;

    typedef __longlong_t    off_t;

This doesn't work under -ansi -pedantic.

I think the optimal fix here is simply to remove -ansi -pedantic.
-ansi may well have some uses, but even the gcc man pages say 
"There is no reason to use this option [-pedantic]; it exists only 
to satisfy pedants."

--- parrot/Configure.pl Tue Jan 15 10:08:15 2002
+++ parrot-andy/Configure.pl    Tue Jan 15 12:33:06 2002
@@ -391,9 +391,14 @@
     # out that you're using 2.7.2 and -Wfoo isn't recognised there, move it up
     # into the next version becone (2.8)
 
-    
+    # Don't use -ansi -pedantic.  It makes it much harder to compile
+    # using the system headers, which may well be tuned to a
+    # non-strict environment -- especially since we are using perl5
+    # compilation flags determined in a non-strict environment.
+    # An example is Solaris 8.
+
     my @opt_and_vers = 
-        (0 => "-Wall -ansi -pedantic -Wstrict-prototypes -Wmissing-prototypes 
-Winline -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings 
-Wconversion -Waggregate-return -Winline -W -Wsign-compare -Wno-unused",
+        (0 => "-Wall -Wstrict-prototypes -Wmissing-prototypes -Winline -Wshadow 
+-Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion 
+-Waggregate-return -Winline -W -Wsign-compare -Wno-unused",
         # others; ones we might like marked with ?
         # ? -Wundef for undefined idenfiers in #if
         # ? -Wbad-function-cast

-- 
    Andy Dougherty              [EMAIL PROTECTED]
    Dept. of Physics
    Lafayette College, Easton PA 18042

Reply via email to