Skip to content

Remove redundant extern keywords from function declarations/definitions. #1495

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

Merged

Conversation

tilmannOSG
Copy link

Extern keywords on function declarations/definitions provide no additional value since function declarations/definitions default to external linkage in C99, e.g. removing them won't change the semantics of the program.

The extern keywords were essentially a legacy from the early days of the project. This commit cleans this up across the whole codebase in one go to minimize history disruption.

The bulk of the changes in this commit were produced by a custom clang-tidy checker.

Note that variables declarations carrying the extern keyword are untouched by this commit since there the presence of the keyword actually has an impact on the semantics of the program.

JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller [email protected]

Extern keywords on function declarations/definitions provide no additional value since function declarations/definitions default to external linkage in C99, e.g. removing them won't change the semantics of the program.

The extern keywords were essentially a legacy from the early days of the project. This commit cleans this up across the whole codebase in one go to minimize history disruption.

The bulk of the changes in this commit were produced by a custom clang-tidy checker.

Note that variables declarations carrying the extern keyword are untouched by this commit since there the presence of the keyword actually has an impact on the semantics of the program.

JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller [email protected]
@LaszloLango LaszloLango added the style Related to coding style label Dec 16, 2016
Copy link
Contributor

@LaszloLango LaszloLango left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@zherczeg zherczeg left a comment

Choose a reason for hiding this comment

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

LGTM

extern ecma_number_t ecma_date_make_date (ecma_number_t, ecma_number_t);
extern ecma_number_t ecma_date_time_clip (ecma_number_t);
extern ecma_number_t ecma_date_timezone_offset (ecma_number_t);

Copy link
Member

Choose a reason for hiding this comment

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

Interesting, this newline should not be a change. Git diff bug?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, there's no change in that line (I just double checked). Probably some heuristic of diff to form a larger block of changes.

@tilmannOSG tilmannOSG merged commit 1e99be9 into jerryscript-project:master Dec 16, 2016
@tilmannOSG tilmannOSG deleted the remove-extern-keyword branch December 16, 2016 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
style Related to coding style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants