public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/113792] New: error: '__size_t' was not declared in this scope
@ 2024-02-06 22:26 danglin at gcc dot gnu.org
  2024-02-07  7:43 ` [Bug libstdc++/113792] " redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: danglin at gcc dot gnu.org @ 2024-02-06 22:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113792
           Summary: error: '__size_t' was not declared in this scope
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: danglin at gcc dot gnu.org
  Target Milestone: ---
              Host: hppa64-hp-hpux11.11
            Target: hppa64-hp-hpux11.11
             Build: hppa64-hp-hpux11.11

I enabled building rust on hppa64-hp-hpux11.11 and hit this error:

/home/dave/gnu/gcc/objdir64/./prev-gcc/x
g++ -B/home/dave/gnu/gcc/objdir64/./prev-gcc/
-B/opt/gnu64/gcc/gcc-14/hppa64-hp-
hpux11.11/bin/ -nostdinc++
-B/home/dave/gnu/gcc/objdir64/prev-hppa64-hp-hpux11.1
1/libstdc++-v3/src/.libs
-B/home/dave/gnu/gcc/objdir64/prev-hppa64-hp-hpux11.11/
libstdc++-v3/libsupc++/.libs  -isystem
/home/dave/gnu/gcc/objdir64/prev-hppa64-h
p-hpux11.11/libstdc++-v3/include/hppa64-hp-hpux11.11  -isystem
/home/dave/gnu/gc
c/objdir64/prev-hppa64-hp-hpux11.11/libstdc++-v3/include  -isystem
/home/dave/gn
u/gcc/gcc/libstdc++-v3/libsupc++
-L/home/dave/gnu/gcc/objdir64/prev-hppa64-hp-hp
ux11.11/libstdc++-v3/src/.libs
-L/home/dave/gnu/gcc/objdir64/prev-hppa64-hp-hpux
11.11/libstdc++-v3/libsupc++/.libs -g -O2 -fno-checking   -c -o punct.o
../../..
/gcc/libgrust/libproc_macro_internal/punct.cc
In file included from
/home/dave/gnu/gcc/gcc-trunk/libstdc++-v3/include/c_global
/cstdlib:79,
                 from ../../../gcc/libgrust/libproc_macro_internal/punct.cc:24:
/usr/include/stdlib.h:349:25: error: '__size_t' was not declared in this scope;
did you mean '__site_t'?
  349 |     extern void *valloc(__size_t);
      |                         ^~~~~~~~
      |                         __site_t
make[4]: *** [<builtin>: punct.o] Error 1
make[4]: Leaving directory
'/home/dave/gnu/gcc/objdir64/libgrust/libproc_macro_internal'
make[3]: *** [Makefile:421: all-recursive] Error 1

This is an #include_next problem.  We have the following in cstdlib:
// Need to ensure this finds the C library's <stdlib.h> not a libstdc++
// wrapper that might already be installed later in the include search path.
#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
#include_next <stdlib.h>
#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS

stdlib.h is fixed on this target.  The #include_next pulled stdlib.h
from /usr/include instead of ./prev-gcc/include-fixed/stdlib.h.

Maybe the fix is to just use #include but I'm not sure.

There are a couple of other places which define
_GLIBCXX_INCLUDE_NEXT_C_HEADERS.

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

* [Bug libstdc++/113792] error: '__size_t' was not declared in this scope
  2024-02-06 22:26 [Bug libstdc++/113792] New: error: '__size_t' was not declared in this scope danglin at gcc dot gnu.org
@ 2024-02-07  7:43 ` redi at gcc dot gnu.org
  2024-02-07 20:57 ` dave.anglin at bell dot net
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2024-02-07  7:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Using #include definitely won't work, that would just create a cycle between
the libstdc++ versions of stdlib.h and cstdlib, at least for all targets that
don't have stdlib.h in include-fixed.

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

* [Bug libstdc++/113792] error: '__size_t' was not declared in this scope
  2024-02-06 22:26 [Bug libstdc++/113792] New: error: '__size_t' was not declared in this scope danglin at gcc dot gnu.org
  2024-02-07  7:43 ` [Bug libstdc++/113792] " redi at gcc dot gnu.org
@ 2024-02-07 20:57 ` dave.anglin at bell dot net
  2024-02-07 21:36 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dave.anglin at bell dot net @ 2024-02-07 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from dave.anglin at bell dot net ---
On 2024-02-07 2:43 a.m., redi at gcc dot gnu.org wrote:
> Using #include definitely won't work, that would just create a cycle between
> the libstdc++ versions of stdlib.h and cstdlib, at least for all targets that
> don't have stdlib.h in include-fixed.
Are you sure?  The file punct.cc compiles successfully on
hppa-unknown-linux-gnu using #include.
It doesn't have stdlib.h in include-fixed.

Doing a full build.

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

* [Bug libstdc++/113792] error: '__size_t' was not declared in this scope
  2024-02-06 22:26 [Bug libstdc++/113792] New: error: '__size_t' was not declared in this scope danglin at gcc dot gnu.org
  2024-02-07  7:43 ` [Bug libstdc++/113792] " redi at gcc dot gnu.org
  2024-02-07 20:57 ` dave.anglin at bell dot net
@ 2024-02-07 21:36 ` redi at gcc dot gnu.org
  2024-02-07 21:38 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2024-02-07 21:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to John David Anglin from comment #0)
> stdlib.h is fixed on this target.  The #include_next pulled stdlib.h
> from /usr/include instead of ./prev-gcc/include-fixed/stdlib.h.

Why did that happen?

For my systems, the include search list is:

ignoring nonexistent directory
"/home/jwakely/gcc/14/lib/gcc/x86_64-pc-linux-gnu/14.0.1/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/jwakely/src/benchmark/include/

/home/jwakely/gcc/14/lib/gcc/x86_64-pc-linux-gnu/14.0.1/../../../../include/c++/14.0.1

/home/jwakely/gcc/14/lib/gcc/x86_64-pc-linux-gnu/14.0.1/../../../../include/c++/14.0.1/x86_64-pc-linux-gnu

/home/jwakely/gcc/14/lib/gcc/x86_64-pc-linux-gnu/14.0.1/../../../../include/c++/14.0.1/backward
 /home/jwakely/gcc/14/lib/gcc/x86_64-pc-linux-gnu/14.0.1/include
 /usr/local/include
 /home/jwakely/gcc/14/include
 /home/jwakely/gcc/14/lib/gcc/x86_64-pc-linux-gnu/14.0.1/include-fixed
 /usr/include
End of search list.

Why is /usr/include coming before the include-fixed dir? That seems wrong.

I'm extremely reluctant to fiddle with the (historically fragile) ordering
between the <cxxx> headers and <xxx.h> headers without understanding exactly
what's happening here, and why.

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

* [Bug libstdc++/113792] error: '__size_t' was not declared in this scope
  2024-02-06 22:26 [Bug libstdc++/113792] New: error: '__size_t' was not declared in this scope danglin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-02-07 21:36 ` redi at gcc dot gnu.org
@ 2024-02-07 21:38 ` redi at gcc dot gnu.org
  2024-02-07 21:43 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2024-02-07 21:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
And we have the same pattern in include/c_global/cmath and
include/bits/std_abs.h so I'm also very reluctant to change just one.

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

* [Bug libstdc++/113792] error: '__size_t' was not declared in this scope
  2024-02-06 22:26 [Bug libstdc++/113792] New: error: '__size_t' was not declared in this scope danglin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-02-07 21:38 ` redi at gcc dot gnu.org
@ 2024-02-07 21:43 ` redi at gcc dot gnu.org
  2024-02-08 15:17 ` danglin at gcc dot gnu.org
  2024-02-10 16:33 ` danglin at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2024-02-07 21:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
https://gcc.gnu.org/pipermail/gcc-patches/2016-January/439448.html described
the reason for the current approach.

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

* [Bug libstdc++/113792] error: '__size_t' was not declared in this scope
  2024-02-06 22:26 [Bug libstdc++/113792] New: error: '__size_t' was not declared in this scope danglin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-02-07 21:43 ` redi at gcc dot gnu.org
@ 2024-02-08 15:17 ` danglin at gcc dot gnu.org
  2024-02-10 16:33 ` danglin at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: danglin at gcc dot gnu.org @ 2024-02-08 15:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from John David Anglin <danglin at gcc dot gnu.org> ---
Created attachment 57360
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57360&action=edit
Patch

As far as I can tell, the attached patch does not cause any regressions
on x86-64.  See:
https://gcc.gnu.org/pipermail/gcc-testresults/2024-February/807425.html

Will upload preprocessed source for punct.cc after current build and check
completes on parisc machine.

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

* [Bug libstdc++/113792] error: '__size_t' was not declared in this scope
  2024-02-06 22:26 [Bug libstdc++/113792] New: error: '__size_t' was not declared in this scope danglin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-02-08 15:17 ` danglin at gcc dot gnu.org
@ 2024-02-10 16:33 ` danglin at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: danglin at gcc dot gnu.org @ 2024-02-10 16:33 UTC (permalink / raw)
  To: gcc-bugs

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

John David Anglin <danglin at gcc dot gnu.org> changed:

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

--- Comment #7 from John David Anglin <danglin at gcc dot gnu.org> ---
Problem disappeared after updating to revision r14-8898-g2bb45562202.

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

end of thread, other threads:[~2024-02-10 16:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-06 22:26 [Bug libstdc++/113792] New: error: '__size_t' was not declared in this scope danglin at gcc dot gnu.org
2024-02-07  7:43 ` [Bug libstdc++/113792] " redi at gcc dot gnu.org
2024-02-07 20:57 ` dave.anglin at bell dot net
2024-02-07 21:36 ` redi at gcc dot gnu.org
2024-02-07 21:38 ` redi at gcc dot gnu.org
2024-02-07 21:43 ` redi at gcc dot gnu.org
2024-02-08 15:17 ` danglin at gcc dot gnu.org
2024-02-10 16:33 ` danglin 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).