Subject: Compiling Mozilla 0.9.8 fails on Alpha
To: None <current-users@netbsd.org>
From: Olaf Seibert <rhialto@polderland.nl>
List: current-users
Date: 03/03/2002 19:38:36
After compiling for a long time, compiling the Mozilla package fails
with this error message:

c++ -o nsCompressedCharMap.o -c -DOSTYPE=\"NetBSD1.5\" -DOSARCH=\"NetBSD\" -DOJI
 -D_IMPL_NS_GFX  -I../../dist/include/xpcom -I../../dist/include/windowwatcher -
I../../dist/include/dom -I../../dist/include/string -I../../dist/include/widget 
-I../../dist/include/locale -I../../dist/include/view -I../../dist/include/pref 
-I../../dist/include/gfx2 -I../../dist/include/imglib2 -I../../dist/include/ucon
v -I../../dist/include/unicharutil -I../../dist/include/gfx -I../../dist/include
 -I/home/tmp/www/mozilla/work.alpha/mozilla/dist/include/nspr  -I/home/tmp/www/m
ozilla/work.alpha/.buildlink/include -I/home/tmp/www/mozilla/work.alpha/.buildli
nk/include   -I/usr/X11R6/include   -fPIC -DPIC  -I/home/tmp/www/mozilla/work.al
pha/.buildlink/include   -I/usr/X11R6/include -fno-rtti -fno-exceptions -Wall -W
conversion -Wpointer-arith -Wbad-function-cast -Wcast-align -Woverloaded-virtual
 -Wsynth -Wno-ctor-dtor-privacy -pedantic -Wno-long-long -I/home/tmp/www/mozilla
/work.alpha/.buildlink/include -I/home/tmp/www/mozilla/work.alpha/.buildlink/inc
lude -O2 -Dunix -pipe  -DNDEBUG -DTRIMMED -O  -I/home/tmp/www/mozilla/work.alpha
/.buildlink/include   -I/usr/X11R6/include -DMOZILLA_CLIENT -include ../../confi
g-defs.h -Wp,-MD,.deps/nsCompressedCharMap.pp nsCompressedCharMap.cpp
nsCompressedCharMap.cpp:395: too many `l's in integer constant
nsCompressedCharMap.cpp:399: too many `l's in integer constant
nsCompressedCharMap.cpp:416: too many `l's in integer constant

/tmp/www/mozilla/work.alpha/mozilla/gfx/src is the current directory.

The relevant lines are these:

395	#if (CCMAP_BITS_PER_ALU == CCMAP_BITS_PER_PRUINT32)
	    SetChars(base, (ALU_TYPE*)frommap_page);
	    frommap_page += CCMAP_PRUINT32S_PER_PAGE;

399	#elif (CCMAP_BITS_PER_ALU > CCMAP_BITS_PER_PRUINT32)
	    int j, k = CCMAP_BITS_PER_PRUINT32;
...
	    SetChars(base, page);
416	#elif (CCMAP_BITS_PER_ALU < CCMAP_BITS_PER_PRUINT32)

These defines stem from the file dist/include/gfx/nsCompressedCharMap.h,
where they are expressed using CCMAP_POW2 in the same file, which again
is defined like this:

#if (ALU_SIZE==32)
#   define ALU_TYPE                PRUint32
#   define CCMAP_POW2(n)           (1L<<(n))
#   define CCMAP_BITS_PER_ALU_LOG2 5
#elif (ALU_SIZE==64)
#   define ALU_TYPE                PRUint64
#   define CCMAP_POW2(n)           (1LL<<(n))
#   define CCMAP_BITS_PER_ALU_LOG2 6
#else
#   define ALU_TYPE                PRUint16
#   define CCMAP_POW2(n)           (1<<(n))
#   define CCMAP_BITS_PER_ALU_LOG2 4
#endif

The LL in the middle case is obviously the culprit.

I try to change the LL info a normal L and will see what happens.
So far, it appears to work.

I do get lots of warnings "warning: cast increases required alignment of
target type" so this does not give me much trust in the code quality...

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert - rhialto@polder --They that can give up essential 
\X/ land.nl --liberty to purchase a little temporary safety
--------------deserve neither liberty or safety. - Benjamin Franklin, 1759
---People will accept your ideas much more readily if you tell them that
---Benjamin Franklin said it first. - Unknown