URL:
  <http://gna.org/bugs/?18872>

                 Summary: Freeciv does not compile with clang
                 Project: Freeciv
            Submitted by: doctorjlowe
            Submitted on: Thu 27 Oct 2011 09:25:41 AM PDT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: 2.3.0
         Discussion Lock: Any
        Operating System: Mac OS
         Planned Release: 

    _______________________________________________________

Details:

Clang is now the default compiler on OSX 10.7 A.K.A Lion, and also OSX 10.6
A.K.A Snow Leopard with the optional XCode 4.2 update.  On those systems, an
ordinary make fails like so:

/bin/sh ../libtool --preserve-dup-deps --silent --tag=CC   --mode=compile
gcc -DHAVE_CONFIG_H -I. -I..   -I/sw/include
-DLOCALEDIR="\"/sw/share/locale\"" -DBINDIR="\"/sw/bin\""
-DDEFAULT_DATA_PATH="\".:data:~/.freeciv/2.3:/sw/share/freeciv\""
-DDEFAULT_SAVES_PATH="\"\""
-DDEFAULT_SCENARIO_PATH="\".:data/scenario:~/.freeciv/2.3/scenarios:~/.freeciv/scenarios:/sw/share/freeciv/scenario\""
-Wall -Wpointer-arith -Wcast-align -Wmissing-prototypes
-Wmissing-declarations -Wno-unused-but-set-variable -Werror -g -O2
-fsigned-char -c -o shared.lo shared.c
shared.c:370:36: error: comparison of unsigned expression >= 0 is always
true [-Werror,-Wtautological-compare]
 while (mantissa != 0 && exponent >= 0) {
                         ~~~~~~~~ ^  ~
/bin/sh ../libtool --preserve-dup-deps --silent --tag=CC   --mode=compile
gcc -DHAVE_CONFIG_H -I. -I..   -I/sw/include
-DLOCALEDIR="\"/sw/share/locale\"" -DBINDIR="\"/sw/bin\""
-DDEFAULT_DATA_PATH="\".:data:~/.freeciv/2.3:/sw/share/freeciv\""
-DDEFAULT_SAVES_PATH="\"\""
-DDEFAULT_SCENARIO_PATH="\".:data/scenario:~/.freeciv/2.3/scenarios:~/.freeciv/scenarios:/sw/share/freeciv/scenario\""
-Wall -Wpointer-arith -Wcast-align -Wmissing-prototypes
-Wmissing-declarations -Wno-unused-but-set-variable -Werror -g -O2
-fsigned-char -c -o md5.lo md5.c
md5.c:148:5: error: cast from 'const unsigned char *' to 'MD5_u32plus *'
(aka 'unsigned int *') increases required alignment from 1 to 4
[-Werror,-Wcast-align]
   STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The workaround for now is to force usage of the less strict llvm compiler,
though i expect clang usage is going to become more widespread.




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?18872>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to