URL:
http://gna.org/patch/?3603
Summary: CodingStyle: Do not initialize variables with
nonsensical values
Project: Freeciv
Submitted by: cazfi
Submitted on: Sat 19 Jan 2013 12:15:22 PM EET
Category: docs
Priority: 5 - Normal
Status: Ready For Test
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Planned Release: 2.3.4, 2.4.0, 2.5.0
___
Details:
This one goes against what earlier days was taught as good programming
practice, but with modern tools I think that *avoiding* variable
initialization just in case makes better code in the long run. Using wrong
value (with what variable happened to be initialized with) doesn't make it any
better than using uninitialized value, but such a initialization hides the
problem from debugging tools (gcc warnings, valgrind reports)
So, attached patch against CodingStyle says that variables for which there's
no correct initialization value, must be left uninitialized.
___
File Attachments:
---
Date: Sat 19 Jan 2013 12:15:22 PM EET Name: DontInitialize.patch Size: 759B
By: cazfi
http://gna.org/patch/download.php?file_id=16973
___
Reply to this item at:
http://gna.org/patch/?3603
___
Message sent via/by Gna!
http://gna.org/
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev