Andrew Benton wrote:
> Hello World!
> 
> Firefox-4.0 in its raw state won't compile with gcc-4.6.0. The build
> grinds to a halt like so:

> c++ -o nsEnumeratorUtils.o -c -I../../dist/stl_wrappers
-I../../dist/system_wrappers -include
/home/andy/firefox-4.0/config/gcc_hidden.h -DOSTYPE=\"Linux2.6\"
-DOSARCH=Linux -DTARGET_XPCOM_ABI=\"x86_64-gcc3\"
-I/home/andy/firefox-4.0/xpcom/glue/../build
-I/home/andy/firefox-4.0/xpcom/glue -I. -I../../dist/include
-I../../dist/include/nsprpub -I/tmp/firefox-build-dir/dist/include/nspr
-I/tmp/firefox-build-dir/dist/include/nss -fPIC -fno-rtti
-fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth
-Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align
-Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -pedantic
-Wno-long-long -fno-strict-aliasing -fshort-wchar -pthread -pipe
-DNDEBUG -DTRIMMED -Os -freorder-blocks -fomit-frame-pointer
-DMOZILLA_CLIENT -include ../../mozilla-config.h -MD -MF
.deps/nsEnumeratorUtils.pp

> /home/andy/firefox-4.0/xpcom/glue/nsEnumeratorUtils.cpp
> /home/andy/firefox-4.0/xpcom/glue/nsEnumeratorUtils.cpp:115:27:
> error: uninitialized const EmptyEnumeratorImpl::kInstance [-fpermissive]
> /home/andy/firefox-4.0/xpcom/glue/nsEnumeratorUtils.cpp:50:7: 

note: const class EmptyEnumeratorImpl has no user-provided default
constructor

> make[5]: *** [nsEnumeratorUtils.o] Error 1

> There are 2 solutions that I know of.
> 1: Set CXXFLAGS to include -fpermissive:
> 
> echo "export CXXFLAGS=\"-march=native -mtune=generic -O2 -pipe \
>   -fpermissive\"" >> mozconfig
> 
> or 
> 2: Patch the Firefox source with this patch:
> 
> https://bugzilla.mozilla.org/attachment.cgi?id=511846&action=diff&context=patch&collapsed=&headers=1&format=raw

Wow.  gcc-4.6 demands a constructor without -fpermissive?

If you have a class that doesn't need a constructor, demanding it seems 
wrong.  It is supposed to call a default (null) constructor.

With a little googling, I see what is happening.  The C++ standard says 
that if a class is instantiated as 'const', it must have a user defined 
constructor.

Well, I learn new stuff all the time.  I guess the other alternative is 
to remove the const from class instantiation.

   -- Bruce
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to