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.
Additional Item Attachment:
File name: DatumUnion.patch Size:2 KB
Reply to this item at:
Message sent via/by Gna!
Freeciv-dev mailing list