OS11.4, gcc 3.3.3 x64: why is pthread_create() changing arg passed in to thread

I am passing a structure pointer to a thread and I know this is a basic thread tactic that I have used countless times, but the value is being changed and the threads gets a segmentation violation!?!

I know arg is defined with restrict keyword and I read a lot of nonsense about the dangers of two pieces of code accessing same memory, but this is also a basic tactic of multithreading, so, I am not sure what is the point of restrict.

I looked at the machine code before the call to pthread_create() and at the beginning of the thread and this code is NOT changing the pointer.

Why/how/where is the pointer being changed(last test: …2CF0 → …27E0)?

How do I disable this nannyCrapware?

I found out what is happening, it is actually passing a pointer to my pointer.

This is weird because my man pages define arg as “void *restrict arg”. I found it somewhere on the web defined as “char *arg[restrict]”, so, I tried extracting what it pointed to and it worked.