Subject: | Re: Ver 0.5 GCC Compile errors: solved |
Date: | Wed, 17 Nov 2010 13:12:49 -0500 |
To: | bug-Syntax-Highlight-Universal [...] rt.cpan.org |
From: | douglas irvine <dci2112 [...] gmail.com> |
*
Issue =>
Compile Errors:
CachingHRCParser.cpp: In member function ‘virtual void
CachingHRCParser::loadFileType(FileType*)’:
CachingHRCParser.cpp:32: error: cast from ‘SchemeImpl*’ to ‘int’ loses
precision
colorer/unicode/BitArray.cpp: In destructor ‘BitArray::~BitArray()’:
colorer/unicode/BitArray.cpp:11: error: cast from ‘int*’ to ‘int’ loses
precision
colorer/unicode/BitArray.cpp: In member function ‘void
BitArray::setBit(int)’:
colorer/unicode/BitArray.cpp:20: error: cast from ‘int*’ to ‘int’ loses
precision
colorer/unicode/BitArray.cpp: In member function ‘void
BitArray::clearBit(int)’:
colorer/unicode/BitArray.cpp:25: error: cast from ‘int*’ to ‘int’ loses
precision
colorer/unicode/BitArray.cpp: In member function ‘void
BitArray::addRange(int, int)’:
colorer/unicode/BitArray.cpp:29: error: cast from ‘int*’ to ‘int’ loses
precision
colorer/unicode/BitArray.cpp: In member function ‘void
BitArray::clearRange(int, int)’:
colorer/unicode/BitArray.cpp:52: error: cast from ‘int*’ to ‘int’ loses
precision
colorer/unicode/BitArray.cpp: In member function ‘void
BitArray::addBitArray(BitArray*)’:
colorer/unicode/BitArray.cpp:73: error: cast from ‘int*’ to ‘int’ loses
precision
colorer/unicode/BitArray.cpp:75: error: cast from ‘int*’ to ‘int’ loses
precision
colorer/unicode/BitArray.cpp: In member function ‘void
BitArray::clearBitArray(BitArray*)’:
colorer/unicode/BitArray.cpp:86: error: cast from ‘int*’ to ‘int’ loses
precision
colorer/unicode/BitArray.cpp:87: error: cast from ‘int*’ to ‘int’ loses
precision
colorer/unicode/BitArray.cpp: In member function ‘void
BitArray::intersectBitArray(BitArray*)’:
colorer/unicode/BitArray.cpp:102: error: cast from ‘int*’ to ‘int’ loses
precision
colorer/unicode/BitArray.cpp:103: error: cast from ‘int*’ to ‘int’ loses
precision
colorer/unicode/BitArray.cpp: In member function ‘void
BitArray::addBitArray(char*, int)’:
colorer/unicode/BitArray.cpp:110: error: cast from ‘int*’ to ‘int’ loses
precision
colorer/unicode/BitArray.cpp: In member function ‘void
BitArray::clearBitArray(char*, int)’:
colorer/unicode/BitArray.cpp:117: error: cast from ‘int*’ to ‘int’ loses
precision
colorer/unicode/BitArray.cpp: In member function ‘bool
BitArray::getBit(int)’:
colorer/unicode/BitArray.cpp:124: error: cast from ‘int*’ to ‘int’ loses
precision
colorer/unicode/Encodings.cpp: In static member function ‘static int
Encodings::getEncodingIndex(const char*)’:
colorer/unicode/Encodings.cpp:48: error: ‘stricmp’ was not declared in this
scope
Solution:
1) use #include <inttypes.h> and (intptr_t) for all casting issues:
i.e.
int pos = (intptr_t)f->baseScheme;
instead of
int pos = (int)f->baseScheme;
2) Fix lack of stricmp by replacing __unix__ with __GNUC__ in
colorer/unicode/String.h and String.cpp, and including #include
<unicode/String.h> in colorer/unicode/Encodings.cpp
GCC version:*
Show quoted text
> gcc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5664~105/src/configure --disable-checking
--enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib
--build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10-
--host=x86_64-apple-darwin10 --target=i686-apple-darwin10
--with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5664)
*Perl Version*
Show quoted text> perl -V
Summary of my perl5 (revision 5 version 8 subversion 9) configuration:
Platform:
osname=darwin, osvers=10.4.0, archname=darwin-2level
uname='darwin susan.local 10.4.0 darwin kernel version 10.4.0: fri apr
23 18:28:53 pdt 2010; root:xnu-1504.7.4~1release_i386 i386 '
config_args='-des -D prefix=/opt/local -D scriptdir=/opt/local/bin -D
cppflags=-I/opt/local/include -D ccflags=-pipe -O2 -arch x86_64 -D
ldflags=-L/opt/local/lib -arch x86_64 -D vendorprefix=/opt/local -D
man1ext=1pm -D man3ext=3pm -D cc=/usr/bin/gcc-4.2 -D ld=/usr/bin/gcc-4.2 -D
man1dir=/opt/local/share/man/man1p -D man3dir=/opt/local/share/man/man3p -D
siteman1dir=/opt/local/share/man/man1 -D
siteman3dir=/opt/local/share/man/man3 -D
vendorman1dir=/opt/local/share/man/man1 -D
vendorman3dir=/opt/local/share/man/man3 -D inc_version_list=5.8.8
5.8.8/darwin-2level -U i_bind -U i_gdbm -U i_db'
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=define use64bitall=define uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='/usr/bin/gcc-4.2', ccflags ='-pipe -O2 -arch x86_64 -fno-common
-DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing
-I/usr/local/include -I/opt/local/include',
optimize='-O3',
cppflags='-I/opt/local/include -no-cpp-precomp -pipe -O2 -arch x86_64
-fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp
-fno-strict-aliasing -I/usr/local/include -I/opt/local/include'
ccversion='', gccversion='4.2.1 (Apple Inc. build 5664)',
gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 /usr/bin/gcc-4.2', ldflags
='-L/opt/local/lib -arch x86_64 -L/usr/local/lib'
libpth=/usr/local/lib /opt/local/lib /usr/lib
libs=-ldbm -ldl -lm -lutil -lc
perllibs=-ldl -lm -lutil -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-L/opt/local/lib -arch x86_64 -bundle
-undefined dynamic_lookup -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT
USE_FAST_STDIO USE_LARGE_FILES USE_PERLIO
Built under darwin
Compiled at Oct 1 2010 19:42:44
%ENV:
PERL5LIB="/perl-5.8.2/lib:/perl-5.8.2/lib/perl5:/perl-5.8.2/lib/site_perl:"
@INC:
/perl-5.8.2/lib
/perl-5.8.2/lib/perl5
/perl-5.8.2/lib/site_perl
/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level
/opt/local/lib/perl5/site_perl/5.8.9
/opt/local/lib/perl5/site_perl
/opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level
/opt/local/lib/perl5/vendor_perl/5.8.9
/opt/local/lib/perl5/vendor_perl
/opt/local/lib/perl5/5.8.9/darwin-2level
/opt/local/lib/perl5/5.8.9
.
Message body is not shown because it is too large.