Skip to content

Build: C: Implicit declaration of function strnlen #433

@foxyseta

Description

@foxyseta

I am having trouble building the latest version (5.0.18.4) via cabal.

[28 of 28] Compiling Hoogle           ( src/Hoogle.hs, dist/build/Hoogle.o, dist/build/Hoogle.dyn_o )

In file included from cbits/text_search.c:2:0: error:
/usr/include/fortify/string.h: In function 'strncat':

/usr/include/fortify/string.h:297:36: error:
     error: implicit declaration of function 'strnlen'; did you mean 'strlen'? [-Wimplicit-function-declaration]
      297 |                 __fh_size_t __sl = strnlen(__s, __n);
          |                                    ^~~~~~~
          |                                    strlen
    |
297 |                 __fh_size_t __sl = strnlen(__s, __n);
    |                                    ^
`gcc' failed in phase `C Compiler'. (Exit code: 1)
Error: cabal: Failed to build hoogle-5.0.18.4 (which is required by exe:hoogle
from hoogle-5.0.18.4). See the build log above for details.

I am on MUSL (Alpine Linux 3.20).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions