Re: [Freeciv-Dev] (PR#39479) warning: type qualifiers ignored on function return type

2007-08-02 Thread William Allen Simpson

http://bugs.freeciv.org/Ticket/Display.html?id=39479 >

Committed revision 13136.



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


Re: [Freeciv-Dev] (PR#39479) warning: type qualifiers ignored on function return type

2007-08-02 Thread William Allen Simpson

http://bugs.freeciv.org/Ticket/Display.html?id=39479 >

Marko Lindqvist wrote:
> gcc version 4.1.3 20070718 (prerelease) (Debian 4.1.2-14)
> 
Another damn gcc 4 incompatibility!

const returns on functions are/were standard C practice to indicate
that the value should not change

Apparently, they changed to an "attribute" to indicate const'edness:

__attribute_const__

You can get rid of the warning with:

-Wno-return-type

But, I'll make the changes anyway.  It will continue to bite us, as
it has other projects all year (according to a quick search).

http://gcc.gnu.org/ml/gcc-help/2007-06/msg00151.html

(and a lot of debian messages, too)

Thanks for checking!



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


Re: [Freeciv-Dev] (PR#39479) warning: type qualifiers ignored on function return type

2007-08-01 Thread Marko Lindqvist

http://bugs.freeciv.org/Ticket/Display.html?id=39479 >

On 01/08/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote:
>
>  I get a lot of warnings like $subject.

 Patch


 - ML

diff -Nurd -X.diff_ignore freeciv/common/government.c freeciv/common/government.c
--- freeciv/common/government.c	2007-08-01 17:17:24.0 +0300
+++ freeciv/common/government.c	2007-08-01 20:11:59.0 +0300
@@ -67,7 +67,7 @@
 /**
   Return the number of governments.
 **/
-const int government_count(void)
+int government_count(void)
 {
   return game.control.government_count;
 }
@@ -78,7 +78,7 @@
   Currently same as government_number(), paired with government_count()
   indicates use as an array index.
 **/
-const int government_index(const struct government *pgovern)
+int government_index(const struct government *pgovern)
 {
   assert(pgovern);
   return pgovern - governments;
@@ -87,7 +87,7 @@
 /**
   Return the government index.
 **/
-const int government_number(const struct government *pgovern)
+int government_number(const struct government *pgovern)
 {
   assert(pgovern);
   return pgovern->item_number;
diff -Nurd -X.diff_ignore freeciv/common/government.h freeciv/common/government.h
--- freeciv/common/government.h	2007-08-01 17:17:24.0 +0300
+++ freeciv/common/government.h	2007-08-01 20:11:02.0 +0300
@@ -59,9 +59,9 @@
 
 
 /* General government accessor functions. */
-const int government_count(void);
-const int government_index(const struct government *pgovern);
-const int government_number(const struct government *pgovern);
+int government_count(void);
+int government_index(const struct government *pgovern);
+int government_number(const struct government *pgovern);
 
 struct government *government_by_number(const int gov);
 struct government *government_of_player(const struct player *pplayer);
diff -Nurd -X.diff_ignore freeciv/common/nation.c freeciv/common/nation.c
--- freeciv/common/nation.c	2007-08-01 17:17:24.0 +0300
+++ freeciv/common/nation.c	2007-08-01 20:12:51.0 +0300
@@ -295,7 +295,7 @@
 /**
   Return the nation index.
 **/
-const Nation_type_id nation_number(const struct nation_type *pnation)
+Nation_type_id nation_number(const struct nation_type *pnation)
 {
   assert(pnation);
   return pnation->item_number;
@@ -307,7 +307,7 @@
   Currently same as nation_number(), paired with nation_count()
   indicates use as an array index.
 **/
-const Nation_type_id nation_index(const struct nation_type *pnation)
+Nation_type_id nation_index(const struct nation_type *pnation)
 {
   assert(pnation);
   return pnation - nations;
@@ -316,7 +316,7 @@
 /
   Return the number of nations.
 /
-const Nation_type_id nation_count(void)
+Nation_type_id nation_count(void)
 {
   return game.control.nation_count;
 }
@@ -493,7 +493,7 @@
 /
   Return the number of nation groups.
 /
-const int nation_group_count(void)
+int nation_group_count(void)
 {
   return num_nation_groups;
 }
@@ -501,7 +501,7 @@
 /**
   Return the nation group index.
 **/
-const int nation_group_index(const struct nation_group *pgroup)
+int nation_group_index(const struct nation_group *pgroup)
 {
   assert(pgroup);
   return pgroup - nation_groups;
@@ -510,7 +510,7 @@
 /**
   Return the nation group index.
 **/
-const int nation_group_number(const struct nation_group *pgroup)
+int nation_group_number(const struct nation_group *pgroup)
 {
   assert(pgroup);
   return pgroup->item_number;
diff -Nurd -X.diff_ignore freeciv/common/nation.h freeciv/common/nation.h
--- freeciv/common/nation.h	2007-08-01 17:17:24.0 +0300
+++ freeciv/common/nation.h	2007-08-01 20:09:57.0 +0300
@@ -109,9 +109,9 @@
 };
 
 /* General nation accessor functions. */
-const Nation_type_id nation_count(void);
-const Nation_type_id nation_index(const struct nation_type *pnation);
-const Nation_type_id na