This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[libstdc++] Problems with backward/alloc.h (patch included)


There is a coding error in include/g++-v3/backward/alloc.h which
prevents the compilation of code employing sequence containers. 
For example, deques do not work.

The appended patch fixes the problem.

Hope this helps,

Peter Schmid

source code t.C
#include <deque.h>

g++ -c t.C -W -Wall
In file included from /usr/local/include/g++-v3/backward/deque.h:59,
                 from t.C:1:
/usr/local/include/g++-v3/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
In file included from /usr/local/include/g++-v3/backward/deque.h:61,
                 from t.C:1:
/usr/local/include/g++-v3/backward/alloc.h:51: `malloc_alloc' not declared

2001-09-04  Scott Johnston <scott@accom.com>
	    Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>

	* include/backward/alloc.h: Conditionally define malloc_alloc 

*** libstdc++-v3/include/backward/alloc.h.orig	Sun Sep 16 21:51:08 2001
--- libstdc++-v3/include/backward/alloc.h	Sun Sep 16 21:51:20 2001
***************
*** 48,54 ****
--- 48,56 ----
  #include <bits/stl_alloc.h>
  
  using std::__malloc_alloc_template; 
+ #ifdef __USE_MALLOC
  using std::malloc_alloc; 
+ #endif
  using std::simple_alloc; 
  using std::debug_alloc; 
  #ifndef __USE_MALLOC


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]