Project

General

Profile

Feature #804349

CodingStyle: Allowing variable declarations middle of the block

Added by Marko Lindqvist 3 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Documentation
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

I propose we relax CodingStyle language about declaring variables in the beginning of the block a bit. While I still prefer variables to be declared before the code in most cases, I would allow exception for example case like this:

int always_needed_variable;

#ifdef FEATURE
int variable_needed_by_feature_code_only;
#endif

some_generic_code();
...

#ifdef FEATURE
variable_needed_by_feature_code_only = 1;
...
#endif /* FEATURE */

This should go into effect in master after S3_1 has been branched.


Related issues

Related to Freeciv - Task #656468: S3_1 branchingIn Progress

History

#1 Updated by Marko Lindqvist 3 months ago

Also available in: Atom PDF