------- Additional Comments From cludwig at cdc dot informatik dot tu-darmstadt 
dot de  2005-06-14 13:19 -------
Subject: Re:  _REENTRANT defined when compiling non-threaded code.

On Mon, Jun 13, 2005 at 03:29:02AM -0000, pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-13 
> 03:29 -------
> Did we decide this is a bug or not?

Strictly speaking, it is not a bug AFAICT because gcc does not violate any
standard. However, current gcc releases make the life unnecessarily hard for
developers because there is no way to decide at compile time (more precisely:
in the preprocessing stage) whether g++ will link against the "real" pthread_*
symbols. They have to resort to their own preprocessor macros
MY_LIB_USE_THREADS and rely on their users who include the respective headers
to (un-)define those macros correctly. So it is a QoI issue. (If I am not
mistaken then gcc is the only compiler for which the Boost libraries cannot
detect automatically whether the code needs to support MT.)

Perhaps I am missing something, but wouldn't it be sufficient if gcc defined a
dedicated preprocessor constant whenever the option -pthreads was found on the
command line? (I know next to nothing about the gcc source code, so I cannot
say whether that would be straightforward to implement.)

Regards

Christoph


-- 


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

Reply via email to