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

CodingStyle: Allowing variable declarations middle of the block

Added by Marko Lindqvist over 3 years ago. Updated over 1 year 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.


Related issues

Related to Freeciv - Task #656468: S3_1 branchingClosed2021-02-06

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by Marko Lindqvist over 3 years ago

#3 Updated by Marko Lindqvist over 1 year ago

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

Also available in: Atom PDF