develooper Front page | perl.perl5.build | Postings from December 2004

Re: Compile error toke.c

Thread Previous | Thread Next
From:
Andrew Dougherty
Date:
December 16, 2004 07:59
Subject:
Re: Compile error toke.c
Message ID:
Pine.SOL.4.58.0412161054550.24543@maxwell.phys.lafayette.edu
On Thu, 16 Dec 2004, Alex wrote:

> Solaris 10, x86; gcc 3.3.2
> While building perl, I'v got:
>
> toke.c: In function `Perl_yylex':
> toke.c:2558: error: cast to union type from type not present in union

I can't reproduce this on Solaris 8, SPARC, with gcc 3.4.1.  Here's line
2558:

     bof = PerlIO_tell(PL_rsfp) == (Off_t)SvCUR(PL_linestr);

It's possible your gcc would be happier with an extra pair of parentheses
around the righthand side of the '=' sign.

You can also try

	make toke.i

to see what that line expands to for your system.  For me, it gave

    bof = Perl_PerlIO_tell(PL_rsfp) == (off64_t)((XPV*) (PL_linestr)->sv_any)->xpv_cur;

which looks fine.

If you suspect your compiler, you can tell it not to optimize (toke.c is
the most tortuous file to optimize) with

	rm toke.o
	make toke.o OPTIMIZE=

to turn off the optimizer for that file.

For comparison, here's the output of my ./myconfig:

Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
  Platform:
    osname=solaris, osvers=2.8, archname=sun4-solaris
    uname='sunos xxx 5.8 generic_117350-02 sun4u sparc sunw,ultra-5_10 '
    config_args='-Dcc=/opt/gcc/bin/gcc -Dprefix=/opt/perl'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='/opt/gcc/bin/gcc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='3.4.1', gccosandvers='solaris2.8'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='/opt/gcc/bin/gcc', ldflags ='-L/usr/local/lib '
    libpth=/usr/local/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'


-- 
    Andy Dougherty		doughera@lafayette.edu

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About