sem_open really strange behavior
Ian Lance Taylor
Tue Jun 22 14:57:00 GMT 2010
Sergio Sobarzo <firstname.lastname@example.org> writes:
> I read that paragraph thousand of times. However it is not an answer
> why it works if a line is commented or not. I cannot figure an
> acceptable explanation, that's why I thought it will be a gcc
Commenting or uncommenting the variable declaration is just changing
the random values that are on the stack when sem_open is called. In
this case I expect it happens to be changing the values between valid
and invalid ones.
Failing to pass required arguments to a variadic function gives you
random behaviour, and that is just what you are seeing.
More information about the Gcc-help