[Freeciv-Dev] [bug #20413] cityrepdata.c: split_string(): 'd.string_value' may be used uninitialized in this function
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
[Freeciv-Dev] [bug #20413] cityrepdata.c: split_string(): 'd.string_value' may be used uninitialized in this function
Follow-up Comment #5, bug #20413 (project freeciv): At this point I wouldn't rule compiler bug out. It gives the warnings only when it has refactored code heavily (optimization level 3) itself first. But this is not proof of compiler bug either. It can be simply that code rearrangement makes it easier for warning heuristics to spot the problem. I just figured out one such a valid warning that appeared only with -O3 (probably related to more aggressive inlining - called function did not always set what caller depended on) ___ 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
[Freeciv-Dev] [bug #20413] cityrepdata.c: split_string(): 'd.string_value' may be used uninitialized in this function
Follow-up Comment #4, bug #20413 (project freeciv): Combination of -O3 and --enable-debug seems to be poison for freeciv compilation. I didn't get nearly as far as you did before first maybe-uninitialized warning. At this point I wouldn't rule compiler bug out. It gives the warnings only when it has refactored code heavily (optimization level 3) itself first. ___ 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
[Freeciv-Dev] [bug #20413] cityrepdata.c: split_string(): 'd.string_value' may be used uninitialized in this function
Follow-up Comment #1, bug #20413 (project freeciv): bug #20219 has the same problem. (I'm inclined to make it duplicate of this one even though it's the older one - this one has useful summary) ___ 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
[Freeciv-Dev] [bug #20413] cityrepdata.c: split_string(): 'd.string_value' may be used uninitialized in this function
Follow-up Comment #2, bug #20413 (project freeciv): gcc (Debian 4.7.2-4) 4.7.2 Interestingly, this is just what I'm using and still not getting this warning/error. What's your arch? I'm on x86_64. Optimization level (-O?) Anyh other CFLAGS? configure options? ___ 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
[Freeciv-Dev] [bug #20413] cityrepdata.c: split_string(): 'd.string_value' may be used uninitialized in this function
Additional Item Attachment, bug #20413 (project freeciv): File name: config.log Size:196 KB File name: config.status Size:105 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
[Freeciv-Dev] [bug #20413] cityrepdata.c: split_string(): 'd.string_value' may be used uninitialized in this function
Follow-up Comment #3, bug #20413 (project freeciv): See attached files, they should help you to debug. I used latest trunk code at revision 22125. ___ 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
[Freeciv-Dev] [bug #20413] cityrepdata.c: split_string(): 'd.string_value' may be used uninitialized in this function
Update of bug #20413 (project freeciv): Summary: 'd.string_value' was declared here = cityrepdata.c: split_string(): 'd.string_value' may be used uninitialized in this function ___ 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