[Freeciv-Dev] [bug #16300] doesn't compile with --enable-debug

2010-07-30 Thread Matthias Pfafferodt

Update of bug #16300 (project freeciv):

  Status:  Ready For Test = Fixed  
 Open/Closed:Open = Closed 


___

Reply to this item at:

  http://gna.org/bugs/?16300

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #16300] doesn't compile with --enable-debug

2010-07-26 Thread Matthias Pfafferodt

Follow-up Comment #1, bug #16300 (project freeciv):

what system do you use? 

The warnings are for variables of type 'size_t' printed 
using '%lu'. What is the type of size_t on your system? As a solution casts
could be added to all lines with warning ...

I do compile using '--enable-debug=checks' and get no errors (opensuse 11.1).

___

Reply to this item at:

  http://gna.org/bugs/?16300

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #16300] doesn't compile with --enable-debug

2010-07-26 Thread Matthias Pfafferodt

Update of bug #16300 (project freeciv):

  Status:None = Ready For Test 
 Assigned to:None = syntron
 Planned Release: = 2.3.0  

___

Follow-up Comment #2:

Here is a patch adding the needed casts.

(file #9564)
___

Additional Item Attachment:

File name: 20100725-04-trunk-cast-size_t-as-unsigned-long.patch Size:3 KB


___

Reply to this item at:

  http://gna.org/bugs/?16300

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #16300] doesn't compile with --enable-debug

2010-07-26 Thread Lavrentij P Berija

Follow-up Comment #3, bug #16300 (project freeciv):

I use Ubuntu Karmic 32 bit. Is there a possibility that these casts can go
wrong on 32 bit or 64 bit?
Compilation of savegame2.c works OK with this patch, but I can't test if
saving/loading the game is correct because of another warning in
gtkitemfactory.h (that's not freeciv's problem, but it prevents me from
compiling the whole source).
Maybe there is a way to compile freeciv with debugging support without
warnings being treated as errors?

___

Reply to this item at:

  http://gna.org/bugs/?16300

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


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


[Freeciv-Dev] [bug #16300] doesn't compile with --enable-debug

2010-07-26 Thread Matthias Pfafferodt

Follow-up Comment #4, bug #16300 (project freeciv):

 I use Ubuntu Karmic 32 bit. Is there a possibility that these
 casts can go wrong on 32 bit or 64 bit? 

This could be the case for size_t ... (32 bit on 32 and 64 bit on 64?)

 Compilation of savegame2.c works OK with this patch, but I
 can't test if saving/loading the game is correct because of
 another warning in gtkitemfactory.h (that's not freeciv's
 problem, but it prevents me from compiling the whole source). 

It's due to an error in gtk and you using '--enable-debug=checks'. If you use
only '--enable-debug=yes' it should work. See patch #1493 and ./doc/HACKING)

 Maybe there is a way to compile freeciv with debugging support
 without warnings being treated as errors?

Yes, use '--enable-debug=yes' or (if it's your system and you can do it)
change one line in gtkitemfactory.h (see the link in ./doc/HACKING).

___

Reply to this item at:

  http://gna.org/bugs/?16300

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #16300] doesn't compile with --enable-debug

2010-07-26 Thread Lavrentij P Berija

Follow-up Comment #5, bug #16300 (project freeciv):

Thanks, it worked out. Saving/loading games works OK, as far as I have
tested.

___

Reply to this item at:

  http://gna.org/bugs/?16300

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


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


[Freeciv-Dev] [bug #16300] doesn't compile with --enable-debug

2010-07-26 Thread Jacob Nevins

Follow-up Comment #6, bug #16300 (project freeciv):

This seems to be a FAQ on comp.lang.c... the consensus there seems to be that
casting to (unsigned long), as file #9564 does, is OK for C90 implementations,
since size_t is guaranteed to fit in that. That's not true for C99, but there
you can use the %zu format specifier (which is specifically for size_t).

However, relying on %zu puts us at the mercy of the system's printf. Looking
at this instance I don't think the risk of a cast to unsigned long losing
information is worth worrying about (it's just an unlikely diagnostic
message), so the cast seems like the best (most portable) solution.

___

Reply to this item at:

  http://gna.org/bugs/?16300

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


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


[Freeciv-Dev] [bug #16300] doesn't compile with --enable-debug

2010-07-25 Thread Lavrentij P Berija

URL:
  http://gna.org/bugs/?16300

 Summary: doesn't compile with --enable-debug
 Project: Freeciv
Submitted by: heilkitty
Submitted on: Понедельник 26.07.2010 at 04:33
Category: general
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: trunk r17607
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

I try to compile trunk with debugging support:

 ./configure --enable-debug

and make fails on  file with the following message:

   CC savegame2.lo
 cc1: warnings being treated as errors
 savegame2.c: In function 'sg_load_players_basic':
 savegame2.c:2814: error: format '%lu' expects type 'long unsigned int', but
argument 7 has type 'size_t'
 savegame2.c:2814: error: format '%lu' expects type 'long unsigned int', but
argument 8 has type 'size_t'
 savegame2.c: In function 'sg_load_player_main':
 savegame2.c:3291: error: format '%lu' expects type 'long unsigned int', but
argument 8 has type 'size_t'
 savegame2.c:3291: error: format '%lu' expects type 'long unsigned int', but
argument 9 has type 'size_t'
 savegame2.c: In function 'sg_load_player_city':
 savegame2.c:3757: error: format '%lu' expects type 'long unsigned int', but
argument 8 has type 'size_t'
 savegame2.c:3757: error: format '%lu' expects type 'long unsigned int', but
argument 9 has type 'size_t'
 savegame2.c: In function 'sg_load_player_vision_city':
 savegame2.c:4843: error: format '%lu' expects type 'long unsigned int', but
argument 8 has type 'size_t'
 savegame2.c:4843: error: format '%lu' expects type 'long unsigned int', but
argument 9 has type 'size_t'
 make[3]: *** [savegame2.lo] Error 1
 make[3]: Leaving directory `/home/heilkitty/soft/freeciv/trunk/server'
 make[2]: *** [all-recursive] Error 1
 make[2]: Leaving directory `/home/heilkitty/soft/freeciv/trunk/server'
 make[1]: *** [all-recursive] Error 1
 make[1]: Leaving directory `/home/heilkitty/soft/freeciv/trunk'
 make: *** [all] Error 2





___

Reply to this item at:

  http://gna.org/bugs/?16300

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


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