This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix for libg++-2.8.1.2 bug
- To: drepper at cygnus dot com
- Subject: [PATCH] Fix for libg++-2.8.1.2 bug
- From: Nix <nix at esperi dot demon dot co dot uk>
- Date: Sun, 15 Nov 1998 16:39:41 +0000 (GMT)
- Cc: egcs at cygnus dot com
There is a bug in the libg++-2.8.1.2 testsuite in that etc/lf/entry.cc
does not compile without optimisation, helting the libg++ testsuite
run (as triggered by, in my case, a `make check' of the egcs suite
with libg++ expanded into the top-level directory as normal).
The fix is simple (and may, indeed, even be in the latest libg++
snapshot; I'm not sure):
*** libg++/etc/lf/entry.cc.orig Sun Nov 15 15:10:34 1998
--- libg++/etc/lf/entry.cc Sun Nov 15 15:14:49 1998
***************
*** 5,10 ****
--- 5,20 ----
/* Initially provide a medium-sized file entry size. */
const int Entry_Handler::default_entries = 50;
+ /* If -O is *not* enabled then this is defined below its first use, so we
+ need a prototype. */
+
+ #ifndef __OPTIMIZE__
+
+ void *
+ operator new (size_t size, void *orig, int number);
+
+ #endif // __OPTIMIZE__
+
/* Print entries to standard output. The algorithm used to format the files
in columns is subtle, and worth studying in some detail. */
***************
*** 68,73 ****
--- 78,91 ----
Entry_Handler::entry_number (void)
{
return entries;
+ }
+
+ /* Allocate a number of new entries at once. */
+
+ void *
+ operator new (size_t size, void *orig, int number)
+ {
+ return realloc (orig, size * number);
}
/* Add an entry to the file class. */
With this in place, the libg++ testsuite runs OK w/o optimisation on
my system.
--
`It would be painful to fix, but it's a lot less painful to fix _now_
rather than later, so maybe the right thing is to just do it and watch
people scream in agony.' - Linus Torvalds on linux-kernel