Skip to content

Linux glibc 2.38 implements strlcat/strlcpy #489

@adrians

Description

@adrians

As per the release-announcement for glibc 2.38 (https://lists.gnu.org/archive/html/info-gnu/2023-07/msg00010.html) :

* The strlcat and strlcpy functions have been added.  They are derived
  from OpenBSD, and are expected to be added to a future POSIX version.

When doing Linux builds for release 1.6 using the updated system library, the strlcat/strlcpy implementations from glibc clash with the implementations from this project (referenced in src/direwolf.h, external/misc/strlcat.c and external/misc/strlcpy.c).

More precisely, when compiling strlcat.c, the compiler first saw the preprocessor-define from src/direwolf.h:301, tried redefining all instances of strlcpy to strlcpy_debug, and then while resolving other include-directives started redefining the strlcpy references from glibc to point to strlcpy_debug.

The error message reported by gcc was about src/direwolf.h:301,302, not explaining too much about the root cause:

expected declaration specifiers or '...' before string constant

While for my purposes I've fixed this bug (the project now compiles under Linux, patch here), I'm also reporting it upstream to raise awareness about this issue (hopefully no-one else wastes time trying to understand the error message in this scenario).

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