Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Fix warnings reported by gcc 6.3 related to misleading indentations.#376

Merged
Ingvord merged 5 commits intotango-controls:tango-9-ltsfrom
bourtemb:fix_misleading_indent-tango-9-lts
Jul 18, 2017
Merged

Fix warnings reported by gcc 6.3 related to misleading indentations.#376
Ingvord merged 5 commits intotango-controls:tango-9-ltsfrom
bourtemb:fix_misleading_indent-tango-9-lts

Conversation

@bourtemb
Copy link
Copy Markdown
Member

The files where these warnings were reported have been formatted by CLion using
the cppTango CLion code style already in use on the master branch.
Added CLion code style settings file based on Allman Braces code style (#364).

bourtemb added 3 commits July 17, 2017 11:25
The files where these warnings were reported have been formatted by CLion using
the cppTango CLion code style already in use on the master branch.
Added CLion code style settings file based on Allman Braces code style (tango-controls#364).
@bourtemb bourtemb requested a review from Ingvord July 18, 2017 10:58
@bourtemb bourtemb assigned Ingvord and unassigned Ingvord Jul 18, 2017
bourtemb added 2 commits July 18, 2017 14:16
Fix some full block{} expected issues in conditionally non-compiled code
(Windows specific code for instance) because CLion does not reformat
conditionally non-compiled code.
Fix some "negation operator used in its short form" issues
Reformated some code in conditionally non-compiled code
@bourtemb
Copy link
Copy Markdown
Member Author

This PR adds a CLion project code style settings file.
The file used in the master branch was used as starting point.
This file has been modified in order to force braces in if/while/do while/for statements since this is what Codacy recommends.
I noticed CLion's Reformat Code feature does not work in conditionally non-compiled code (#ifdef code when condition is false) but Codacy also complains about issues in the conditionally non-compiled code, which is good.

For the record, Travis CI tests didn't pass the first time for the DEBUG version.
It complained about an assertion failed on new_tests/cxx_fwd_att.cpp:749 (cb.cb_err == 1).
I restarted the test and it passed successfully the second time.

It seems Codacy is reporting some false positive issues in devapi_data.cpp. It says some conditions are always true. In this specific case, this is not true, otherwise this would mean all the DeviceData extraction operators are not working when extracting to a vector.

@Ingvord
Copy link
Copy Markdown
Member

Ingvord commented Jul 18, 2017

I would ignore some of the braces for instance in this case:

if(...) return;// or return some simple value

I usually write this in one line as above.

Copy link
Copy Markdown
Member

@Ingvord Ingvord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@Ingvord Ingvord merged commit 08ab170 into tango-controls:tango-9-lts Jul 18, 2017
@bourtemb bourtemb deleted the fix_misleading_indent-tango-9-lts branch July 19, 2017 11:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants