Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Feature #804349

closed

CodingStyle: Allowing variable declarations middle of the block

Added by Marko Lindqvist over 4 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Documentation
Sprint/Milestone:
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.


Files


Related issues

Related to Freeciv - Task #656468: S3_1 branchingClosedMarko Lindqvist2021-02-06

Actions
Actions #1

Updated by Marko Lindqvist over 4 years ago

Actions #3

Updated by Marko Lindqvist over 2 years ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF