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

Remove unnecessary "extern" from function declarations #3726

Merged
merged 3 commits into from
Dec 20, 2022

Conversation

lrstewart
Copy link
Contributor

@lrstewart lrstewart commented Dec 19, 2022

Resolved issues:

resolves #1618

Description of changes:

"extern" is meaningless when applied to functions. Function declarations are "extern" by default.

I applied the basic replacement s/extern (.*) (.*)\(/$1 $2(/ to the codebase to remove the externs from function declarations. The \( in the regex prevents it from applying to variables, where "extern" actually has meaning.

Call-outs:

All these changes were done automatically (except for the new check in grep_simple_mistakes.sh).

Testing:

grep_simple_mistakes.sh passes.

If I add back one extern to s2n_tls13.h, it fails with:

Found unnecessary 'extern' in function declaration
/home/lrstewart/Code/s2n-tls/tls/s2n_tls13.h:extern bool s2n_use_default_tls13_config();
FAILED Grep For Simple Mistakes check

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@lrstewart lrstewart changed the title Kill extern Remove unnecessary "extern" from function declarations Dec 20, 2022
@lrstewart lrstewart marked this pull request as ready for review December 20, 2022 00:37
@lrstewart lrstewart requested a review from dougch as a code owner December 20, 2022 00:37
@lrstewart lrstewart requested review from maddeleine, harrisonkaiser and dougch and removed request for dougch December 20, 2022 00:38
grep on zsh seems to concat the lines into one filename
-exec skips the intermediate variable
@lrstewart lrstewart requested a review from dougch December 20, 2022 01:29
Copy link
Contributor

@dougch dougch left a comment

Choose a reason for hiding this comment

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

zsh is happy

@lrstewart lrstewart merged commit 1cb1e58 into aws:main Dec 20, 2022
@lrstewart lrstewart deleted the kill_extern branch December 20, 2022 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove "extern" from function declarations in header files
3 participants