Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FreeBSD] strict_fstream.hpp:77:26: error: invalid conversion from 'int' to 'char*' #60

Closed
yurivict opened this issue Dec 2, 2022 · 6 comments
Labels

Comments

@yurivict
Copy link

yurivict commented Dec 2, 2022

The LBANN project that uses zstr fails to compile:

In file included from /usr/local/include/zstr.hpp:15,
                 from /disk-samsung/freebsd-ports/misc/lbann/work/lbann-0.102-254-g2e3012a9a/include/lbann/data_readers/sample_list_impl.hpp:57,
                 from /disk-samsung/freebsd-ports/misc/lbann/work/lbann-0.102-254-g2e3012a9a/include/lbann/data_readers/data_reader_sample_list_impl.hpp:32,
                 from /disk-samsung/freebsd-ports/misc/lbann/work/lbann-0.102-254-g2e3012a9a/src/data_readers/data_reader_smiles.cpp:29:
/usr/local/include/strict_fstream.hpp: In function 'std::string strict_fstream::strerror()':
/usr/local/include/strict_fstream.hpp:77:26: error: invalid conversion from 'int' to 'char*' [-fpermissive]
   77 |     char * p = strerror_r(errno, &buff[0], buff.size());
      |                ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                          |
      |                          int

gcc-11
FreeBSD 13.1

@ferdymercury
Copy link
Collaborator

@ferdymercury
Copy link
Collaborator

@sandsmark fixed this part of the code in the past

@ferdymercury
Copy link
Collaborator

Does it get solved if you add the following line before #include <zstr.hpp>?

#define __MUSL__

@yurivict
Copy link
Author

yurivict commented Dec 3, 2022

Does it get solved if you add the following line before #include <zstr.hpp>?

#define MUSL

Yes

@ferdymercury
Copy link
Collaborator

If you want, provide a PullRequest, where you add in the https://github.com/mateidavid/zstr/blob/master/src/strict_fstream.hpp wherever MUSL appears, paste also the variable FreeBSD
so that you do not need to do the define-MUSL trick.

@ferdymercury ferdymercury changed the title strict_fstream.hpp:77:26: error: invalid conversion from 'int' to 'char*' [FreeBSD] strict_fstream.hpp:77:26: error: invalid conversion from 'int' to 'char*' Dec 3, 2022
@yurivict
Copy link
Author

yurivict commented Dec 3, 2022

I patched the FreeBSD port to add defined(__FreeBSD__)next to the defined(__APPLE__).
You can just do the same in the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants