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



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



Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to