Follow-up Comment #9, bug #18217 (project freeciv):

Attached patch fixes trunk for me.  I had to disable one warning, which
conflicts with gtkitemfactory.h:

/* We use () here to mean unspecified arguments. This is deprecated
 * as of C99, but we can't change it without breaking compatibility.
 * (Note that if we are included from a C++ program () will mean
 * (void) so an explicit cast will be needed.)
typedef void    (*GtkItemFactoryCallback)  ();

I also added a macro for marking unused variables within iterate macros.  For

  adjc_dir_iterate(tile0, tile1, dir) {
    array[dir] = 1;
  } adjc_dir_iterate_end;

the tile1 variable is unused, and really can't be used nor is it worthwhile
to write a new iterator for this case.  (This was mentioned earlier in the bug
as well.)  Adding UNUSED_VAR(tile1) marks it as unused for both the compiler
and should be good for coders reading it as well.

#define UNUSED_VAR(x) (void)(x)

There is probably a better definition that could be used here however.

Finally there is one location in api_server_edit.c where a return value looks
to me like it should be checked, but since it wasn't it triggered the warning.
 I added a FIXME there but am not familiar enough with the code to know if
it's actually a problem.

(file #14260)

Additional Item Attachment:

File name: fix_compile_warnings_trunk.diff Size:13 KB


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to