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

checks: Add missing function prototypes #2727

Merged
merged 11 commits into from
Jan 22, 2023

Conversation

nilason
Copy link
Contributor

@nilason nilason commented Jan 4, 2023

This adds most, but not all, missing function prototypes.

Aaron Ballman, from llvm, summarise:

Functions without prototypes have never been a recommended practice in any standard version of C. In fact, they were introduced into C89 as already being deprecated (see C89 3.9.4 and 3.9.5). After a 35+ year deprecation period, C2x will be removing support for functions with identifier lists (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf) and will be changing the behavior of prototypeless functions with empty parentheses to match the behavior of C++ (N 2841: No function declarators without prototypes).

It is only a question of time before this must be fixed, but for a clearer and safer code I think there is no need to wait.

These fixes are trivial, but there were 4 files needing special attention and will be object for separate issues/pull requests.

@nilason nilason added enhancement New feature or request C Related code is in C labels Jan 4, 2023
@nilason nilason added this to the 8.3.0 milestone Jan 4, 2023
@nilason nilason mentioned this pull request Jan 15, 2023
12 tasks
@nilason
Copy link
Contributor Author

nilason commented Jan 17, 2023

If there are no objections to this PR, I'll merge it in the next few days.
I have further PRs in line, which builds on this.

@nilason nilason merged commit c38dd6c into OSGeo:main Jan 22, 2023
@nilason nilason deleted the fix-Wstrict-prototypes-warnings branch January 22, 2023 13:21
a0x8o added a commit to a0x8o/grass that referenced this pull request Jan 23, 2023
This adds most, but not all, missing function prototypes.

Aaron Ballman from llvm, summarise:
(https://discourse.llvm.org/t/rfc-enabling-wstrict-prototypes-by-default-in-c/60521):

> Functions without prototypes have never been a recommended practice
> in any standard version of C. In fact, they were introduced into C89
> as already being deprecated (see C89 3.9.4 and 3.9.5). After a 35+
> year deprecation period, C2x will be removing support for functions
> with identifier list
> (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf) and will be
> changing the behavior of prototypeless functions with empty parentheses
> to match the behavior of C++ (N 2841: No function declarators without
> prototypes).

a statement, which may provide as a short background as well as motivation
for this commit.
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
This adds most, but not all, missing function prototypes.

Aaron Ballman from llvm, summarise: 
(https://discourse.llvm.org/t/rfc-enabling-wstrict-prototypes-by-default-in-c/60521):

> Functions without prototypes have never been a recommended practice
> in any standard version of C. In fact, they were introduced into C89
> as already being deprecated (see C89 3.9.4 and 3.9.5). After a 35+
> year deprecation period, C2x will be removing support for functions
> with identifier list
> (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf) and will be
> changing the behavior of prototypeless functions with empty parentheses
> to match the behavior of C++ (N 2841: No function declarators without
> prototypes).

a statement, which may provide as a short background as well as motivation
for this commit.
@wenzeslaus wenzeslaus changed the title Fix missing function prototypes checks: Add missing function prototypes Jun 6, 2023
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
This adds most, but not all, missing function prototypes.

Aaron Ballman from llvm, summarise: 
(https://discourse.llvm.org/t/rfc-enabling-wstrict-prototypes-by-default-in-c/60521):

> Functions without prototypes have never been a recommended practice
> in any standard version of C. In fact, they were introduced into C89
> as already being deprecated (see C89 3.9.4 and 3.9.5). After a 35+
> year deprecation period, C2x will be removing support for functions
> with identifier list
> (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf) and will be
> changing the behavior of prototypeless functions with empty parentheses
> to match the behavior of C++ (N 2841: No function declarators without
> prototypes).

a statement, which may provide as a short background as well as motivation
for this commit.
a0x8o added a commit to a0x8o/grass that referenced this pull request May 9, 2024
This adds most, but not all, missing function prototypes.

Aaron Ballman from llvm, summarise:
(https://discourse.llvm.org/t/rfc-enabling-wstrict-prototypes-by-default-in-c/60521):

> Functions without prototypes have never been a recommended practice
> in any standard version of C. In fact, they were introduced into C89
> as already being deprecated (see C89 3.9.4 and 3.9.5). After a 35+
> year deprecation period, C2x will be removing support for functions
> with identifier list
> (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf) and will be
> changing the behavior of prototypeless functions with empty parentheses
> to match the behavior of C++ (N 2841: No function declarators without
> prototypes).

a statement, which may provide as a short background as well as motivation
for this commit.
a0x8o added a commit to a0x8o/grass that referenced this pull request May 21, 2024
This adds most, but not all, missing function prototypes.

Aaron Ballman from llvm, summarise:
(https://discourse.llvm.org/t/rfc-enabling-wstrict-prototypes-by-default-in-c/60521):

> Functions without prototypes have never been a recommended practice
> in any standard version of C. In fact, they were introduced into C89
> as already being deprecated (see C89 3.9.4 and 3.9.5). After a 35+
> year deprecation period, C2x will be removing support for functions
> with identifier list
> (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf) and will be
> changing the behavior of prototypeless functions with empty parentheses
> to match the behavior of C++ (N 2841: No function declarators without
> prototypes).

a statement, which may provide as a short background as well as motivation
for this commit.
a0x8o added a commit to a0x8o/grass that referenced this pull request Jun 3, 2024
This adds most, but not all, missing function prototypes.

Aaron Ballman from llvm, summarise:
(https://discourse.llvm.org/t/rfc-enabling-wstrict-prototypes-by-default-in-c/60521):

> Functions without prototypes have never been a recommended practice
> in any standard version of C. In fact, they were introduced into C89
> as already being deprecated (see C89 3.9.4 and 3.9.5). After a 35+
> year deprecation period, C2x will be removing support for functions
> with identifier list
> (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf) and will be
> changing the behavior of prototypeless functions with empty parentheses
> to match the behavior of C++ (N 2841: No function declarators without
> prototypes).

a statement, which may provide as a short background as well as motivation
for this commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant