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

error: format not a string literal and no format arguments #42

Open
chris-martin opened this issue Sep 15, 2016 · 1 comment
Open

error: format not a string literal and no format arguments #42

chris-martin opened this issue Sep 15, 2016 · 1 comment

Comments

@chris-martin
Copy link

chris-martin commented Sep 15, 2016

I'm getting this error trying to build:

src/socket.cpp: In member function 'int czmqpp::socket::bind(const string&)':
src/socket.cpp:63:47: error: format not a string literal and no format arguments [-Werror=format-security]
     return zsocket_bind(self_, address.c_str());
                                               ^
src/socket.cpp: In member function 'int czmqpp::socket::connect(const string&)':
src/socket.cpp:68:50: error: format not a string literal and no format arguments [-Werror=format-security]
     return zsocket_connect(self_, address.c_str());
                                                  ^
cc1plus: some warnings being treated as errors
make: *** [Makefile:608: src/socket.lo] Error 1

Versions:

  • czmqpp 1.2.0
  • czmq 3.0.2
  • g++ 5.4.0
@chris-martin chris-martin changed the title What version of czmq does czmqpp compile against? error: format not a string literal and no format arguments Sep 15, 2016
@chris-martin
Copy link
Author

I'm not sure why the -Wno-format-security workaround from 30d12c0 isn't working, but I think the real fix is as simple as using a format string of %s, e.g.

return zsocket_connect(self_, "%s", address.c_str());

rather than

return zsocket_connect(self_, address.c_str());

(not sure though, I'm no C++ expert)

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

No branches or pull requests

1 participant