[Bug c++/20099] -pthreads should imply -fno-threadsafe-statics

davids at webmaster dot com gcc-bugzilla@gcc.gnu.org
Sun Feb 20 15:11:00 GMT 2005


------- Additional Comments From davids at webmaster dot com  2005-02-20 02:50 -------

You say, "how can someone know that A will modify memory"? The answer is, the
C++ standard says so, section 7.1.2. They simply read that section of the
standard, and they know that the function might modify memory. If they know for
sure that it won't in a particular case, they are safe. If they don't know, and
it might modify memory, then POSIX requires them to put in a mutex.

You cannot create code that works with this option and doesn't work without it
except by violating the POSIX standard. So POSIX code should not have this
option enabled by default -- it's a pure pessimization.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20099



More information about the Gcc-bugs mailing list