Skip to content

strnlen and Cygwin compatability - catch_tostring.hpp #2511

@rey-gomez

Description

@rey-gomez

I was trying to make autodiff (https://autodiff.github.io/installation/) using cmake and the most recent version of Catch2 on Cygwin, but would always run into an error at the cmake --build . --target install. I finally narrowed down my issue thanks to this error message :

/usr/local/include/catch2/catch_tostring.hpp: In static member function ‘static std::string Catch::StringMaker<char [SZ]>::convert(const char)’:
/usr/local/include/catch2/catch_tostring.hpp:214:33: error: there are no arguments to ‘strnlen’ that depend on a template parameter, so a declaration of ‘strnlen’ must be available [-fpermissive]

I think the issue is that in the file catch_tostring.hpp there is a call to 'strnlen' that is unfortunately not supported in Cygwin (microsoft/GSL#331).

I have tried to debug my issue by editing this file and changing the strnlen calls.

I understand there are several limitations to using cygwin and I am posting this here in case anyone else has this issue. Please let me know if this is not a bug and there was an issue in my implementation.

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