public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol
@ 2011-07-14 10:29 mathieu.malaterre at gmail dot com
  2011-07-14 10:32 ` [Bug libstdc++/49745] " rguenth at gcc dot gnu.org
                   ` (26 more replies)
  0 siblings, 27 replies; 28+ messages in thread
From: mathieu.malaterre at gmail dot com @ 2011-07-14 10:29 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: error: ‘int truncate’ redeclared as different kind of
                    symbol
           Product: gcc
           Version: 4.4.5
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mathieu.malaterre@gmail.com


Hi,

  g++ pollutes the global namespace. The following does not compile with G++
4.4.5:


#include <iostream>
int truncate = 0;
int main()
{
  return 0;
}

If fails with:


t.cxx:2: error: ‘int truncate’ redeclared as different kind of symbol
/usr/include/unistd.h:998: error: previous declaration of ‘int truncate(const
char*, __off_t)’


Thanks !


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
@ 2011-07-14 10:32 ` rguenth at gcc dot gnu.org
  2011-07-14 10:52 ` redi at gcc dot gnu.org
                   ` (25 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-07-14 10:32 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.07.14 10:30:57
          Component|c++                         |libstdc++
     Ever Confirmed|0                           |1
      Known to fail|                            |4.6.1
           Severity|major                       |normal

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-14 10:30:57 UTC ---
Confirmed.


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
  2011-07-14 10:32 ` [Bug libstdc++/49745] " rguenth at gcc dot gnu.org
@ 2011-07-14 10:52 ` redi at gcc dot gnu.org
  2011-07-14 11:02 ` redi at gcc dot gnu.org
                   ` (24 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: redi at gcc dot gnu.org @ 2011-07-14 10:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-07-14 10:51:57 UTC ---
dup of PR 36231 ?


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
  2011-07-14 10:32 ` [Bug libstdc++/49745] " rguenth at gcc dot gnu.org
  2011-07-14 10:52 ` redi at gcc dot gnu.org
@ 2011-07-14 11:02 ` redi at gcc dot gnu.org
  2011-07-14 11:13 ` redi at gcc dot gnu.org
                   ` (23 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: redi at gcc dot gnu.org @ 2011-07-14 11:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-07-14 11:01:26 UTC ---
the problem is actually in gthr-posix.h

no libstdc++ header includes <unistd.h> except <ext/stdio_syn_filebuf.h> which
is a non-standard extension and so that's not a problem


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (2 preceding siblings ...)
  2011-07-14 11:02 ` redi at gcc dot gnu.org
@ 2011-07-14 11:13 ` redi at gcc dot gnu.org
  2011-07-14 12:02 ` paolo.carlini at oracle dot com
                   ` (22 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: redi at gcc dot gnu.org @ 2011-07-14 11:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-07-14 11:13:13 UTC ---
Why does gthr-posix.h even include <unistd.h>?

--- gcc/gthr-posix.h.orig       2011-07-14 11:09:00.148778460 +0000
+++ gcc/gthr-posix.h    2011-07-14 11:09:01.763786789 +0000
@@ -39,7 +39,6 @@
 #endif

 #include <pthread.h>
-#include <unistd.h>

 typedef pthread_t __gthread_t;
 typedef pthread_key_t __gthread_key_t;


The names from <pthread.h> will still be declared, but that's a LOT better than
bringing in everything from <unistd.h>

If some crufty OS needs <unistd.h> it should only be included conditionally


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (3 preceding siblings ...)
  2011-07-14 11:13 ` redi at gcc dot gnu.org
@ 2011-07-14 12:02 ` paolo.carlini at oracle dot com
  2011-07-14 12:08 ` paolo.carlini at oracle dot com
                   ` (21 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-07-14 12:02 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-07-14 12:01:40 UTC ---
Who maintains gthr-posix.h? Indeed, in general, this is a well known issue, can
be resolved as dup.


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (4 preceding siblings ...)
  2011-07-14 12:02 ` paolo.carlini at oracle dot com
@ 2011-07-14 12:08 ` paolo.carlini at oracle dot com
  2011-07-14 12:13 ` redi at gcc dot gnu.org
                   ` (20 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-07-14 12:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-07-14 12:07:45 UTC ---
Before resolving as dup of 36231, let's add in CC Jakub too, it would be nice
if for 4.7 we could finally take the plunge and follow Jon's suggestion, or a
variant of it, but I don't know who normally fiddles with the gthr-* headers...


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (5 preceding siblings ...)
  2011-07-14 12:08 ` paolo.carlini at oracle dot com
@ 2011-07-14 12:13 ` redi at gcc dot gnu.org
  2011-07-14 12:31 ` paolo.carlini at oracle dot com
                   ` (19 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: redi at gcc dot gnu.org @ 2011-07-14 12:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-07-14 12:13:27 UTC ---
I don't think there is a maintainer for gthreads


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (6 preceding siblings ...)
  2011-07-14 12:13 ` redi at gcc dot gnu.org
@ 2011-07-14 12:31 ` paolo.carlini at oracle dot com
  2011-07-14 12:34 ` jakub at gcc dot gnu.org
                   ` (18 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-07-14 12:31 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |paolo.carlini at oracle dot
                   |                            |com, ro at CeBiTec dot
                   |                            |Uni-Bielefeld.DE

--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-07-14 12:30:43 UTC ---
"Worst" case we can regression test your simple change on Linux (and maybe
another target normally using the Posix model, Rainer on Solaris?) and send it
out to the mailing list for review. A global maintainer could approve it.


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (7 preceding siblings ...)
  2011-07-14 12:31 ` paolo.carlini at oracle dot com
@ 2011-07-14 12:34 ` jakub at gcc dot gnu.org
  2011-07-14 12:35 ` jakub at gcc dot gnu.org
                   ` (17 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-07-14 12:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-07-14 12:33:16 UTC ---
svn blame isn't hard to use.
You'll find out that the unistd.h include was added by
http://gcc.gnu.org/ml/gcc-patches/2002-10/msg01666.html
There are still some of the unistd.h guard macros used in gthr*, so you can't
just drop that.  But, two of the three macros are limited to libobjc (the
scheduling stuff), so if it wasn't for _POSIX_TIMEOUTS for
__gthread_mutex_timedwait, you could guard the unistd.h include with
#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)
Unfortunately, the remaining one, _POSIX_TIMEOUTS and defining
__gthread_mutex_timedlock if it is present, is used in libstdc++ (<mutex> in
particular, and apparently unconditionally there, so it will just not compile
on prehistoric OSes which lack pthread_mutex_timedlock or on systems that don't
use gthr-posix.h but other gthr-*.h headers instead).
So, if you want to avoid including unistd.h, you'd need to e.g. add some
configure test in libstdc++ and in gthr-posix.h use
#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK) \
    || !defined(_GTHR_HAS_POSIX_TIMEOUTS)
#include <unistd.h>
#ifdef _POSIX_TIMEOUTS
#define _GTHR_HAS_POSIX_TIMEOUTS _POSIX_TIMEOUTS
#endif
#endif
and use _GTHR_HAS_POSIX_TIMEOUTS instead of _POSIX_TIMEOUTS in gthr.h and
arrange
for libstdc++ headers to define _GTHR_HAS_POSIX_TIMEOUTS based on whether
<unistd.h> defines _POSIX_TIMEOUTS.


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (8 preceding siblings ...)
  2011-07-14 12:34 ` jakub at gcc dot gnu.org
@ 2011-07-14 12:35 ` jakub at gcc dot gnu.org
  2011-07-14 12:45 ` paolo.carlini at oracle dot com
                   ` (16 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-07-14 12:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-07-14 12:34:32 UTC ---
BTW, <mutex> really shouldn't be using __gthread_mutex_timedlock if it isn't
available...


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (9 preceding siblings ...)
  2011-07-14 12:35 ` jakub at gcc dot gnu.org
@ 2011-07-14 12:45 ` paolo.carlini at oracle dot com
  2011-07-14 21:51 ` paolo.carlini at oracle dot com
                   ` (15 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-07-14 12:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-07-14 12:43:53 UTC ---
Thanks Jakub. Thus, seems a little more difficult than we hoped, but still
doable. We'll give a try to your scheme.


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (10 preceding siblings ...)
  2011-07-14 12:45 ` paolo.carlini at oracle dot com
@ 2011-07-14 21:51 ` paolo.carlini at oracle dot com
  2011-07-14 21:55 ` jakub at gcc dot gnu.org
                   ` (14 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-07-14 21:51 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|rguenth at gcc dot gnu.org  |nicola.pero@meta-innovation
                   |                            |.com

--- Comment #12 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-07-14 21:50:25 UTC ---
Before going ahead as suggested by Jakub, maybe Nicola can double check that
libobjc still wants those <unistd.h> includes?


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (11 preceding siblings ...)
  2011-07-14 21:51 ` paolo.carlini at oracle dot com
@ 2011-07-14 21:55 ` jakub at gcc dot gnu.org
  2011-07-14 22:00 ` paolo.carlini at oracle dot com
                   ` (13 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-07-14 21:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-07-14 21:54:36 UTC ---
I think only libstdc++ installs the gthr* headers, all other uses inside of gcc
just include it in library *.c files rather than headers, so for _LIBOBJC it
IMHO shouldn't be harmful if unistd.h is included.


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (12 preceding siblings ...)
  2011-07-14 21:55 ` jakub at gcc dot gnu.org
@ 2011-07-14 22:00 ` paolo.carlini at oracle dot com
  2011-07-15 10:24 ` paolo.carlini at oracle dot com
                   ` (12 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-07-14 22:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-07-14 21:58:55 UTC ---
Sure Jakub. I was only wondering if maybe, after all these years, turns out
that libobjc doesn't really need that include anymore. We could simplify the
macros a bit...


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (13 preceding siblings ...)
  2011-07-14 22:00 ` paolo.carlini at oracle dot com
@ 2011-07-15 10:24 ` paolo.carlini at oracle dot com
  2011-07-15 10:51 ` jakub at gcc dot gnu.org
                   ` (11 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-07-15 10:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-07-15 10:24:15 UTC ---
By the way, Jakub, correct me if I'm wrong and/or remember incorrectly what we
decided here at the time, but as far as I can see there is no risk with
__gthread_mutex_timedlock, because if it's unavailable, _GLIBCXX_HAS_GTHREADS
is undefined and the entire <mutex> ins't available. It can be argued that we
should do this in a finer grained way, but that's another issue...


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (14 preceding siblings ...)
  2011-07-15 10:24 ` paolo.carlini at oracle dot com
@ 2011-07-15 10:51 ` jakub at gcc dot gnu.org
  2011-07-15 10:53 ` paolo.carlini at oracle dot com
                   ` (10 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-07-15 10:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-07-15 10:47:46 UTC ---
Then you probably could use _GLIBCXX_HAS_GTHREADS as the macro to avoid
including unistd.h and assuming that _POSIX_TIMEOUT is defined.
Though perhaps better would be to call it _GTHREADS_ASSUME_POSIX_TIMEOUTS or
similar and define it in some libstdc++ headers before including gthr.h.


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (15 preceding siblings ...)
  2011-07-15 10:51 ` jakub at gcc dot gnu.org
@ 2011-07-15 10:53 ` paolo.carlini at oracle dot com
  2011-07-15 11:54 ` paolo.carlini at oracle dot com
                   ` (9 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-07-15 10:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-07-15 10:53:11 UTC ---
Indeed, I was having the same thought... _GLIBCXX_HAS_GTHREADS is a bit
stricter though (doesn't allow 0), but would do. And I agree that in that case
we should use another name. Essentially, about the ordering, just double check
that, as should normally be, c++config.h is included before anything else.


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (16 preceding siblings ...)
  2011-07-15 10:53 ` paolo.carlini at oracle dot com
@ 2011-07-15 11:54 ` paolo.carlini at oracle dot com
  2011-07-15 12:10 ` paolo.carlini at oracle dot com
                   ` (8 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-07-15 11:54 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|paolo.carlini at oracle dot |
                   |com                         |
         AssignedTo|unassigned at gcc dot       |paolo.carlini at oracle dot
                   |gnu.org                     |com
   Target Milestone|---                         |4.7.0


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (17 preceding siblings ...)
  2011-07-15 11:54 ` paolo.carlini at oracle dot com
@ 2011-07-15 12:10 ` paolo.carlini at oracle dot com
  2011-07-15 21:53 ` paolo at gcc dot gnu.org
                   ` (7 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-07-15 12:10 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |igodard at pacbell dot net

--- Comment #18 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-07-15 12:09:04 UTC ---
*** Bug 36231 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (18 preceding siblings ...)
  2011-07-15 12:10 ` paolo.carlini at oracle dot com
@ 2011-07-15 21:53 ` paolo at gcc dot gnu.org
  2011-07-15 21:55 ` paolo.carlini at oracle dot com
                   ` (6 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: paolo at gcc dot gnu.org @ 2011-07-15 21:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2011-07-15 21:52:14 UTC ---
Author: paolo
Date: Fri Jul 15 21:52:06 2011
New Revision: 176335

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176335
Log:
/gcc
2011-07-15  Paolo Carlini  <paolo.carlini@oracle.com>
        Jakub Jelinek  <jakub@redhat.com>
        Jonathan Wakely  <jwakely.gcc@gmail.com>

    PR libstdc++/49745
    * gthr-posix.h: Do not include <unistd.h> unconditionally; use
    _GTHREADS_USE_MUTEX_TIMEDLOCK instead of _POSIX_TIMEOUTS.

/libstdc++-v3
2011-07-15  Paolo Carlini  <paolo.carlini@oracle.com>
        Jakub Jelinek  <jakub@redhat.com>

    PR libstdc++/49745
    * acinclude.m4 ([GLIBCXX_CHECK_GTHREADS]): Check separately for
    _POSIX_TIMEOUTS and define _GTHREADS_USE_MUTEX_TIMEDLOCK.
    * libstdc++-v3/libsupc++/guard.cc: Include <unistd.h>.
    * testsuite/17_intro/headers/c++1998/49745.cc: New.
    * configure: Regenerate.
    * config.h.in: Likewise.

Added:
    trunk/libstdc++-v3/testsuite/17_intro/headers/c++1998/49745.cc
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gthr-posix.h
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/acinclude.m4
    trunk/libstdc++-v3/config.h.in
    trunk/libstdc++-v3/configure
    trunk/libstdc++-v3/libsupc++/guard.cc


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (19 preceding siblings ...)
  2011-07-15 21:53 ` paolo at gcc dot gnu.org
@ 2011-07-15 21:55 ` paolo.carlini at oracle dot com
  2021-10-10 12:51 ` hjl.tools at gmail dot com
                   ` (5 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-07-15 21:55 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to work|                            |4.7.0
         Resolution|                            |FIXED

--- Comment #20 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-07-15 21:55:38 UTC ---
Fixed for 4.7.0.


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (20 preceding siblings ...)
  2011-07-15 21:55 ` paolo.carlini at oracle dot com
@ 2021-10-10 12:51 ` hjl.tools at gmail dot com
  2021-10-25 18:30 ` law at gcc dot gnu.org
                   ` (4 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: hjl.tools at gmail dot com @ 2021-10-10 12:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49745

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #21 from H.J. Lu <hjl.tools at gmail dot com> ---
This now fails with glibc 2.34:

/export/gnu/import/git/gitlab/x86-gcc-lam/libstdc++-v3/testsuite/17_intro/headers/c++1998/49745.cc:22:
error: 'int truncate' redeclared as different kind of entity
In file included from /usr/include/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from
/export/build/gnu/tools-build/gcc-lam-sde/build-x86_64-linux/x86_64-pc-linux-gnu/libstdc++-v3/include/csignal:42,
                 from
/export/build/gnu/tools-build/gcc-lam-sde/build-x86_64-linux/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/stdc++.h:43,
                 from <command-line>:
/usr/include/unistd.h:1022: note: previous declaration 'int truncate(const
char*, __off_t)'
compiler exited with status 1
FAIL: 17_intro/headers/c++1998/49745.cc (test for excess errors)

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (21 preceding siblings ...)
  2021-10-10 12:51 ` hjl.tools at gmail dot com
@ 2021-10-25 18:30 ` law at gcc dot gnu.org
  2021-11-10 12:04 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: law at gcc dot gnu.org @ 2021-10-25 18:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49745

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu.org

--- Comment #22 from Jeffrey A. Law <law at gcc dot gnu.org> ---
It's failing because sigstksz.h includes unistd.h which brings in the prototype
for truncate which conflicts with the definition of truncate in the test.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (22 preceding siblings ...)
  2021-10-25 18:30 ` law at gcc dot gnu.org
@ 2021-11-10 12:04 ` cvs-commit at gcc dot gnu.org
  2021-11-24 11:50 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-10 12:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49745

--- Comment #23 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:77963796aef8aa07993c0bc757c15848fab7432a

commit r12-5109-g77963796aef8aa07993c0bc757c15848fab7432a
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Nov 10 11:43:46 2021 +0000

    libstdc++: Fix test for libstdc++ not including <unistd.h> [PR100117]

    The <cxxx> headers for the C library are not under our control, so we
    can't prevent them from including <unistd.h>. Change the PR 49745 test
    to only include the C++ library headers, not the <cxxx> ones.

    To ensure <bits/stdc++.h> isn't included automatically we need to use
    no_pch to disable PCH.

    libstdc++-v3/ChangeLog:

            PR libstdc++/100117
            * testsuite/17_intro/headers/c++1998/49745.cc: Explicitly list
            all C++ headers instead of including <bits/stdc++.h>

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (23 preceding siblings ...)
  2021-11-10 12:04 ` cvs-commit at gcc dot gnu.org
@ 2021-11-24 11:50 ` cvs-commit at gcc dot gnu.org
  2022-01-08 10:51 ` pinskia at gcc dot gnu.org
  2022-04-26 13:12 ` cvs-commit at gcc dot gnu.org
  26 siblings, 0 replies; 28+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-24 11:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49745

--- Comment #24 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:176e55cc28a61b7b246bd9e16ffeaa31367a8985

commit r11-9277-g176e55cc28a61b7b246bd9e16ffeaa31367a8985
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Nov 10 11:43:46 2021 +0000

    libstdc++: Fix test for libstdc++ not including <unistd.h> [PR100117]

    The <cxxx> headers for the C library are not under our control, so we
    can't prevent them from including <unistd.h>. Change the PR 49745 test
    to only include the C++ library headers, not the <cxxx> ones.

    To ensure <bits/stdc++.h> isn't included automatically we need to use
    no_pch to disable PCH.

    libstdc++-v3/ChangeLog:

            PR libstdc++/100117
            * testsuite/17_intro/headers/c++1998/49745.cc: Explicitly list
            all C++ headers instead of including <bits/stdc++.h>

    (cherry picked from commit 77963796aef8aa07993c0bc757c15848fab7432a)

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (24 preceding siblings ...)
  2021-11-24 11:50 ` cvs-commit at gcc dot gnu.org
@ 2022-01-08 10:51 ` pinskia at gcc dot gnu.org
  2022-04-26 13:12 ` cvs-commit at gcc dot gnu.org
  26 siblings, 0 replies; 28+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-08 10:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49745

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|REOPENED                    |RESOLVED

--- Comment #25 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
It was fixed in GCC 4.7.0, just the test case was failing with the newer glibc.
The testcase was fixed so closing back as fixed for GCC 4.7.0.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/49745] error: ‘int truncate’ redeclared as different kind of symbol
  2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
                   ` (25 preceding siblings ...)
  2022-01-08 10:51 ` pinskia at gcc dot gnu.org
@ 2022-04-26 13:12 ` cvs-commit at gcc dot gnu.org
  26 siblings, 0 replies; 28+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-26 13:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49745

--- Comment #26 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:436891d97aef6d7a8e107d2d3e02e8ca4c52a51a

commit r10-10571-g436891d97aef6d7a8e107d2d3e02e8ca4c52a51a
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Apr 12 11:12:47 2021 +0100

    libstdc++: Fix test for libstdc++ not including <unistd.h> [PR100117]

    The <cxxx> headers for the C library are not under our control, so we
    can't prevent them from including <unistd.h>. Change the PR 49745 test
    to only include the C++ library headers, not the <cxxx> ones.

    To ensure <bits/stdc++.h> isn't included automatically we need to use
    no_pch to disable PCH.

    libstdc++-v3/ChangeLog:

            PR libstdc++/100117
            * testsuite/17_intro/headers/c++1998/49745.cc: Explicitly list
            all C++ headers instead of including <bits/stdc++.h>

    (cherry picked from commit 77963796aef8aa07993c0bc757c15848fab7432a)

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2022-04-26 13:12 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-14 10:29 [Bug c++/49745] New: error: ‘int truncate’ redeclared as different kind of symbol mathieu.malaterre at gmail dot com
2011-07-14 10:32 ` [Bug libstdc++/49745] " rguenth at gcc dot gnu.org
2011-07-14 10:52 ` redi at gcc dot gnu.org
2011-07-14 11:02 ` redi at gcc dot gnu.org
2011-07-14 11:13 ` redi at gcc dot gnu.org
2011-07-14 12:02 ` paolo.carlini at oracle dot com
2011-07-14 12:08 ` paolo.carlini at oracle dot com
2011-07-14 12:13 ` redi at gcc dot gnu.org
2011-07-14 12:31 ` paolo.carlini at oracle dot com
2011-07-14 12:34 ` jakub at gcc dot gnu.org
2011-07-14 12:35 ` jakub at gcc dot gnu.org
2011-07-14 12:45 ` paolo.carlini at oracle dot com
2011-07-14 21:51 ` paolo.carlini at oracle dot com
2011-07-14 21:55 ` jakub at gcc dot gnu.org
2011-07-14 22:00 ` paolo.carlini at oracle dot com
2011-07-15 10:24 ` paolo.carlini at oracle dot com
2011-07-15 10:51 ` jakub at gcc dot gnu.org
2011-07-15 10:53 ` paolo.carlini at oracle dot com
2011-07-15 11:54 ` paolo.carlini at oracle dot com
2011-07-15 12:10 ` paolo.carlini at oracle dot com
2011-07-15 21:53 ` paolo at gcc dot gnu.org
2011-07-15 21:55 ` paolo.carlini at oracle dot com
2021-10-10 12:51 ` hjl.tools at gmail dot com
2021-10-25 18:30 ` law at gcc dot gnu.org
2021-11-10 12:04 ` cvs-commit at gcc dot gnu.org
2021-11-24 11:50 ` cvs-commit at gcc dot gnu.org
2022-01-08 10:51 ` pinskia at gcc dot gnu.org
2022-04-26 13:12 ` cvs-commit at gcc dot gnu.org

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).