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

tests: fix compilation with modern compilers #1537

Merged
merged 1 commit into from Apr 3, 2024

Conversation

eli-schwartz
Copy link
Contributor

GCC 14 and clang 16, after 20+ years, finally enforce c99 language requirements. Previously, to keep old code compiling, the use of K&R C constructs was simply allowed despite the standard, and so users could accidentally use those constructs without realizing it or being warned.

Now, the compiler fatally errors out when encountering the problematic code. This can also be observed in older versions of the compiler by using the following flags:

-Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types

In hamlib's case, the use of a function without declaring it is illegal. It's also a very simple fix though -- the standard header which declared the stdlib exit() function was forgotten and never included. Simply add the missing include, and make the source code automatically compliant.

Bug: https://bugs.gentoo.org/923108

GCC 14 and clang 16, after 20+ years, finally enforce c99 language
requirements. Previously, to keep old code compiling, the use of K&R C
constructs was simply allowed despite the standard, and so users could
accidentally use those constructs without realizing it or being warned.

Now, the compiler fatally errors out when encountering the problematic
code. This can also be observed in older versions of the compiler by
using the following flags:

```
-Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types
```

In hamlib's case, the use of a function without declaring it is illegal.
It's also a very simple fix though -- the standard header which declared
the stdlib exit() function was forgotten and never included. Simply add
the missing include, and make the source code automatically compliant.

Bug: https://bugs.gentoo.org/923108
@eli-schwartz
Copy link
Contributor Author

Probably broken by #1091, huh. 🤔

@mdblack98 mdblack98 merged commit 00ceb6e into Hamlib:master Apr 3, 2024
4 checks passed
@eli-schwartz eli-schwartz deleted the c99-porting branch April 3, 2024 22:07
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

Successfully merging this pull request may close these issues.

None yet

2 participants