-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
warning about app_thread_info_t.tid not initialized #34
Comments
There's no portable PTHREAD_NULL constant. Can you check whether zeroing the memory gets rid of the warning? memset (&info, 0, sizeof (info); |
This is my solution: I have checked that this eliminates the warning (and of course the latency performance test is working with it). If you agree with it - please just do a pull from my branch. This fixup is also MIT licensed. |
I don't like the idea of putting bogus thread ID to the structure. It's just begging for problems. Can you check the memset (&into, 0, sizeof (info)) solution? |
Checked, memset() also solves the problem. You can cherry-pick the latest commit from my branch (MIT licensed). |
Done. Thanks! |
Solution: backport the latest STDINT definitions from libzmq. Fixes zeromq#34
Fixing issue zeromq#34
The QNX C++ compiler, which is a bit more restrictive than GCC emits the following warning:
ctx.cpp:153: note: 'info.zmq::ctx_t::app_thread_info_t::tid' was declared here
.While this caused by the call to
app_threads.push_back (info);
(line 160) because uninitialized value is stored in the container. This value is assigned just few lines below (line169),app_threads [current].tid = thread_t::id ();
, so probably it is not a problem.This can be however be an issue if incidentally some exception would be thrown in the meantime - we would end up with uninitialized data in the container.
I think the solution is to:
app_thread_info_t
structtid
to some value before storing the data in a container.The problem is that this warning (together with
-Werror
) does not allow for a clean build under QNX.The text was updated successfully, but these errors were encountered: