public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "carlo at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/11953] _REENTRANT defined when compiling non-threaded code.
Date: Fri, 08 Oct 2004 13:53:00 -0000	[thread overview]
Message-ID: <20041008135355.6645.qmail@sourceware.org> (raw)
In-Reply-To: <20030817022106.11953.carlo@alinoe.com>


------- Additional Comments From carlo at gcc dot gnu dot org  2004-10-08 13:53 -------
This wording is very boost specific and does not give
a solution for other libraries that need to detect
at prepocessing time whether or not -pthread is
being used.

Consider a library libjohndoe, this library comes in two
flavours: one that is not thread-safe (-ljohndoe) and
one that is thread-safe, but considerably slower and
larger so that users really only want to use it when
they are actually using threads (-ljohndoe_r).

The header files of libjohndoe also need to adjust
prototypes and macros based on whether a user is linking
with -ljohndoe or -ljohndoe_r, so a macro is needed.
If that macro is not provided by -pthreads, then the
users of libjohndoe will be forced to provide it themselfs:

g++ app.cc -ljohndoe

or

g++ -pthread app.cc -DMT_JOHNDOE -ljohndoe_r -lpthread

In my opinion that is the same as when users of Tru64
are forced to define _REENTRANT when including pthread.h
and when that is not acceptable then forcing user-defined
macros to be defined in order to tell whether or not
an application is expected to be thread-safe (while previous
this was not necessary) seems at least to be undesirable.

Most importantly however - it is totally unnecessary.
At all times there will be this -pthread commandline
option that imho has exactly the meaning that we are
looking for: This application is using threads and needs
thread-safe libraries.

Wouldn't it be a very reasonable and logical solution
to define some, any, macro when -pthread is used on the
command line?  It would solve my problem and it would
solve boosts problem, and it would solve the problem
of the author of libjohndoe too.

I think this new macro really must be added to 4.0.0
before its release.



-- 


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


  parent reply	other threads:[~2004-10-08 13:53 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-17  2:21 [Bug c++/11953] New: " carlo at alinoe dot com
2003-08-17  2:28 ` [Bug c++/11953] " pinskia at gcc dot gnu dot org
2003-08-17  2:37 ` [Bug other/11953] " pinskia at gcc dot gnu dot org
2003-08-17  2:56 ` carlo at alinoe dot com
2003-09-10 12:55 ` bkoz at gcc dot gnu dot org
2004-04-15 14:17 ` carlo at gcc dot gnu dot org
2004-05-13 15:02 ` pinskia at gcc dot gnu dot org
2004-05-13 15:56 ` redi at gcc dot gnu dot org
2004-05-14 16:26 ` [Bug libstdc++/11953] " bangerth at dealii dot org
2004-05-14 17:08 ` ljrittle at gcc dot gnu dot org
2004-05-14 17:40 ` john at johnmaddock dot co dot uk
2004-05-15 20:34 ` pinskia at gcc dot gnu dot org
2004-05-19 10:33 ` ro at techfak dot uni-bielefeld dot de
2004-05-19 13:16 ` redi at gcc dot gnu dot org
2004-05-20  0:10 ` john at johnmaddock dot co dot uk
2004-06-09 19:18 ` mmitchel at gcc dot gnu dot org
2004-06-09 19:25 ` ro at techfak dot uni-bielefeld dot de
2004-06-09 19:30   ` Andrew Pinski
2004-06-09 19:30 ` pinskia at physics dot uc dot edu
2004-06-09 19:37 ` ro at techfak dot uni-bielefeld dot de
2004-06-18 23:41 ` mmitchel at gcc dot gnu dot org
2004-07-20  0:50 ` bkoz at gcc dot gnu dot org
2004-07-22 13:19 ` redi at gcc dot gnu dot org
2004-07-22 13:40 ` giovannibajo at libero dot it
2004-08-19 20:30 ` mmitchel at gcc dot gnu dot org
2004-09-10 15:25 ` pinskia at gcc dot gnu dot org
2004-10-08 13:13 ` redi at gcc dot gnu dot org
2004-10-08 13:53 ` carlo at gcc dot gnu dot org [this message]
2004-10-11 11:39 ` redi at gcc dot gnu dot org
2004-10-11 12:22 ` redi at gcc dot gnu dot org
2004-10-30 19:37 ` mmitchel at gcc dot gnu dot org
2005-05-19 17:35 ` mmitchel at gcc dot gnu dot org
2005-06-13  3:29 ` pinskia at gcc dot gnu dot org
2005-06-14 13:19 ` cludwig at cdc dot informatik dot tu-darmstadt dot de
2005-07-15 22:05 ` pinskia at gcc dot gnu dot org
2005-07-29 11:26 ` david dot nospam dot hopwood at blueyonder dot co dot uk
2005-07-29 12:20 ` david dot nospam dot hopwood at blueyonder dot co dot uk
2005-07-29 13:35 ` redi at gcc dot gnu dot org
     [not found] <bug-11953-794@http.gcc.gnu.org/bugzilla/>
2005-10-07  3:12 ` gdr at gcc dot gnu dot org
2005-11-28 13:37 ` marc dot waeckerlin at siemens dot com
2005-11-29  9:14 ` marc dot waeckerlin at siemens dot com
2005-11-29  9:27 ` marc dot waeckerlin at siemens dot com
2005-11-29  9:34 ` marc dot waeckerlin at siemens dot com
2005-11-29 16:06 ` carlo at gcc dot gnu dot org
2006-02-17 21:49 ` jakub at gcc dot gnu dot org
2006-02-28  8:47 ` gdr at gcc dot gnu dot org
2006-10-05 16:06 ` debian-gcc at lists dot debian dot org
2006-12-11 18:13 ` dberlin at gcc dot gnu dot org
2006-12-12 15:15 ` jakub at gcc dot gnu dot org
2006-12-12 15:22 ` jakub at gcc dot gnu dot org
2006-12-12 15:24 ` jakub at gcc dot gnu dot org
2006-12-13  9:38 ` pinskia at gcc dot gnu dot org
2006-12-17 13:47 ` doko at gcc dot gnu dot org
2006-12-17 13:53 ` doko at gcc dot gnu dot org
2006-12-17 13:57 ` doko at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041008135355.6645.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).