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

error: a function declaration without a prototype is deprecated in all versions of C #105

Open
thierry-FreeBSD opened this issue Mar 7, 2023 · 1 comment

Comments

@thierry-FreeBSD
Copy link

This error is produced with recent clang (>= 15).
Actually this is just a warning, but since -Werror,-Wstrict-prototype is set, it becomes an error:

FAILED: CMakeFiles/test_c99.dir/test/test_c99.c.o 
/usr/local/libexec/ccache/cc -DLIBDIVIDE_SSE2 -I/wrkdirs/usr/ports/math/libdivide/work/libdivide-5.0 -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -DNDEBUG -Wall -Wextra -pedantic -Werror -fno-lax-vector-conversions -march=native -fno-vectorize -std=gnu99 -MD -MT CMakeFiles/test_c99.dir/test/test_c99.c.o -MF CMakeFiles/test_c99.dir/test/test_c99.c.o.d -o CMakeFiles/test_c99.dir/test/test_c99.c.o -c /wrkdirs/usr/ports/math/libdivide/work/libdivide-5.0/test/test_c99.c
/wrkdirs/usr/ports/math/libdivide/work/libdivide-5.0/test/test_c99.c:51:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void test_u16() {
             ^
              void
/wrkdirs/usr/ports/math/libdivide/work/libdivide-5.0/test/test_c99.c:62:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void test_s16() {
             ^
              void
/wrkdirs/usr/ports/math/libdivide/work/libdivide-5.0/test/test_c99.c:77:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void test_u32() {
             ^
              void
/wrkdirs/usr/ports/math/libdivide/work/libdivide-5.0/test/test_c99.c:84:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void test_s32() {
             ^
              void
/wrkdirs/usr/ports/math/libdivide/work/libdivide-5.0/test/test_c99.c:91:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void test_u64() {
             ^
              void
/wrkdirs/usr/ports/math/libdivide/work/libdivide-5.0/test/test_c99.c:98:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void test_s64() {
             ^
              void
6 errors generated.

@kimwalisch
Copy link
Collaborator

Thanks to the LLVM devs for causing useless work in downstream projects! Apparently this warning only applies to C99 through C17, from C23 on having a function declaration without a prototype is legal again (see: https://reviews.llvm.org/D122895)

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