Well, sort of identical. I have some old threaded C code that I was tinkering with. I put it on my personal server and it compiles and runs just great. I have an old notebook where I installed FreeBSD from scratch, put the same server and everything else on it--identical to what's on the VPS. 12.0-RELEASE p8. I compile the exact same code with the same version of clang but I get a warning:
It comes from this line:
at the point (void*)i
The program works as it should on my notebook but I don't understand why there is a warning on one system but not the other. It sounds familiar, as if I've had this issue years ago, and there was a configuration somewhere that I was unaware of and now have forgotten.
So my question is not how to fix the code but why the long running system on a VPS does not give me the same warning that the new install on my notebook does?
Code:
warning: cast to 'void *' from smaller integer type 'int'
Code:
for (i = 1; i < THREAD_COUNT; i++)
pthread_create(&id[i], NULL, doit, (void*)i);
The program works as it should on my notebook but I don't understand why there is a warning on one system but not the other. It sounds familiar, as if I've had this issue years ago, and there was a configuration somewhere that I was unaware of and now have forgotten.
So my question is not how to fix the code but why the long running system on a VPS does not give me the same warning that the new install on my notebook does?