Follow-up Comment #2, bug #18481 (project freeciv):

It does not make the warning go away. The attached diff does, however I have
no idea what consequences it might have. I don't use LUA, I can't really test

You split this bug report in two, however the following is relevant to both
of them:

cc1: warnings being treated as errors
ruleset.c: In function 'load_ruleset_game':
ruleset.c:3231: warning: cast increases required alignment of target type

And ruleset.c:3231 is:

   3230   food_ini = secfile_lookup_int_vec(file, (size_t *)
   3231                                     &,
   3232                                     "civstyle.granary_food_ini");

secfile_lookup_int_vec, where the bus error occurs.

The attached diff makes the warnings go away, but not the problem. I believe
the "patched" lua code will produce more bus errors, regardless of the type
the pointers are cast to. The solution to this is make a temporary variable,
and copy stuff to it. That way it will be aligned. If not that, then add some
__alignment__ (8) attribute to that LUA struct.

Here is a relevant document:

(file #13833)

Additional Item Attachment:

File name: fc.diff                        Size:1 KB


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to