Skip to content

Build failure on macOS #8642

Closed
Closed

Description

@masaori335
../include/tscpp/util/TsSharedMutex.h:62:14: error: incompatible integer to pointer conversion assigning to 'const char *' from 'int'
    _c_str = strerror_r(err_num, _buf, 256);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It looks like macOS has POSIX version strerror_r only.

STRERROR(3)                                                Library Functions Manual                                                STRERROR(3)

NAME
     perror, strerror, strerror_r, sys_errlist, sys_nerr – system error messages

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
...
     int
     strerror_r(int errnum, char *strerrbuf, size_t buflen);
...
STANDARDS
     The perror() and strerror() functions conform to ISO/IEC 9899:1999 (“ISO C99”).  The strerror_r() function conforms to IEEE Std
     1003.1-2001 (“POSIX.1”).     

Activity

  1. added
    Build
    on Feb 4, 2022
  2. self-assigned this
    on Feb 4, 2022
  3. linked a pull request that will close this issueMake TsSharedMutex.h compile on MacOS. #8645on Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BuildmacOS

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions