Default style (Cherry Eve). Switch styles (Capricorn). XML Feed Calendar
All | General
20040826 Thursday August 26, 2004

GCC 3.3.3

Yesterday, a build error reported against mozilla/modules/libpref/src/nsPrefBranch.cpp, it was

nsPrefBranch.cpp:88: error: brace-enclosed initializer used to
initialize `const char*'

It used to work fine for months with gcc 3.2.2, but apparently gcc 3.3.3 changed the rule. (I wonder why the Ireland team changed their kernel & compiler without notifying us.)

It's not difficult to find the gcc-3.3.3 source tarball from one of their mirror sites. The build procedure is pretty straight forward:

  1. extract the source into srcdir;
  2. make a new dir to hold the obj files objdir;
  3. run ../srcdir/configure --prefix=$HOME/local from objdir;
  4. make bootstrap;
  5. make install;

Everything will be built up and installed in your $HOME/local/bin, setting CC=$HOME/local/bin/gcc, CXX=$HOME/local/bin/c++, you will be able to build mozilla using the new compiler.

BTW, the error was:

static const char* gSystemPrefKeys[] = {
    {"network.proxy.http"},
    {"network.proxy.http_port"},
    ...

Removing the {} around the strings fixed it. I don't understand why all other compilers (VC, gcc 3.2.2, Forte) are happy with that but gcc 3.3.3 doesn't.

August 26, 2004 03:08 AM PDT Permalink

Calendar

August 2004 »
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
28
29
30
    
       
Today

Links


Navigation


Referers

Today's Page Hits: 19