Skip to content

Fails to build with GCC 14 due to -Wimplicit-function-declaration #158

@glaubitz

Description

@glaubitz

Trying to build python-crfsuite with GCC 14 fails because of the enforced -Wimplicit-function-declaration:

[   42s] gcc -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -DOPENSSL_LOAD_CONF -fwrapv -fno-semantic-interposition -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -IVendor/ -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -IVendor/ -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fPIC -Icrfsuite/include/ -Icrfsuite/lib/cqdb/include -Iliblbfgs/include -Ipycrfsuite -I/usr/include/python3.10 -c -std=c99 crfsuite/lib/crf/src/crf1d_context.c -o build/temp.linux-x86_64-cpython-310/crfsuite/lib/crf/src/crf1d_context.o
[   42s] In file included from crfsuite/lib/crf/src/crf1d_context.c:47:
[   42s] crfsuite/lib/crf/src/vecmath.h: In function ‘_aligned_malloc’:
[   42s] crfsuite/lib/crf/src/vecmath.h:50:15: error: implicit declaration of function ‘posix_memalign’ [-Wimplicit-function-declaration]
[   42s]    50 |     int ret = posix_memalign(&p, alignment, size);
[   42s]       |               ^~~~~~~~~~~~~~
[   42s] crfsuite/lib/crf/src/crf1d_context.c: In function ‘crf1dc_new’:
[   42s] crfsuite/lib/crf/src/crf1d_context.c:71:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
[   42s]    71 |         if (ret = crf1dc_set_num_items(ctx, T)) {
[   42s]       |             ^~~
[   42s] crfsuite/lib/crf/src/crf1d_context.c: In function ‘crf1dc_score’:
[   42s] crfsuite/lib/crf/src/crf1d_context.c:440:15: warning: unused variable ‘L’ [-Wunused-variable]
[   42s]   440 |     const int L = ctx->num_labels;
[   42s]       |               ^
[   42s] crfsuite/lib/crf/src/crf1d_context.c:438:38: warning: unused variable ‘cur’ [-Wunused-variable]
[   42s]   438 |     const floatval_t *state = NULL, *cur = NULL, *trans = NULL;
[   42s]       |                                      ^~~
[   42s] error: command '/usr/bin/gcc' failed with exit code 1

To reproduce, build with GCC 14 as the default C/C++ compiler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions