Update of bug #20413 (project freeciv):

                  Status:                    None => Ready For Test         
         Planned Release:                         => 2.3.4, 2.4.0, 2.5.0    

    _______________________________________________________

Follow-up Comment #6:

What compiler was complaining was that datum with numeric value, and string
value uninitialized, was copied to vector. What it didn't see was that users
of the vector always respect "is_numeric" boolean and never access string
value of such a datum. (If it had seen real problem, it would have pointed the
actual use of the uninitialized value, not where it got copied).

Still, it doesn't make sense to have separate numerical value and string value
for a datum when there's ever only one of them used. Attached patch makes them
an union (minimal optimization to both memory and CPU usage (as structure is
copied around)). As union always gets initialized with either numerical or
string value, this fixes also the original uninitialized value warning.

(file #16983)
    _______________________________________________________

Additional Item Attachment:

File name: DatumUnion.patch               Size:2 KB


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  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