Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coding style changes: deprecated and override #1620

Closed
mikee47 opened this issue Feb 14, 2019 · 5 comments
Closed

Coding style changes: deprecated and override #1620

mikee47 opened this issue Feb 14, 2019 · 5 comments
Milestone

Comments

@mikee47
Copy link
Contributor

mikee47 commented Feb 14, 2019

I'm working on a PR to enforce use of __ attribute__((deprecated)) throughout the framework; I'm proposing to use a macro __deprecated for convenience. The purpose is to ensure the framework (including samples) builds without internally referencing any deprecated items. Travis enforces this. It will also assist users in migrating their code.

The second item is to apply override to every overridden virtual function. The purpose is to catch typing errors; using virtual with a mis-spelled method name or parameter type will simply create a new method. Using override will throw a warning if the base method isn't declared virtual.

One possible point of contention is whether to use virtual or override on inherited destructors. I'm thinking not, as it doesn't add anything and can actually confuse. virtual destructors do not behave like regular virtual methods, and typos are already flagged by the compiler.

Any other 'modernisations' we can consider?

Thoughts?

@slaff slaff added this to the 3.7.2 milestone Feb 14, 2019
@slaff
Copy link
Contributor

slaff commented Feb 14, 2019

One possible point of contention is whether to use virtual or override on inherited destructors. I'm thinking not, as it doesn't add anything and can actually confuse.

Correct.

@mikee47
Copy link
Contributor Author

mikee47 commented Feb 14, 2019

What's the thinking on empty overridden destructors? Remove or keep?

@slaff
Copy link
Contributor

slaff commented Feb 15, 2019

What's the thinking on empty overridden destructors? Remove or keep?

Remove.

@mikee47
Copy link
Contributor Author

mikee47 commented Feb 15, 2019

Is there any justification for using #include <SmingCore/SmingCore.h> in applications when #include <SmingCore.h> is sufficient?

@slaff
Copy link
Contributor

slaff commented Feb 16, 2019

Is there any justification for using #include <SmingCore/SmingCore.h> in applications when #include <SmingCore.h> is sufficient?

I cannot think of any ... So yes, please, use SmingCore.h instead of SmingCore/SmingCore.h .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants