This is the mail archive of the gcc-help@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]
Other format: [Raw text]

mall_alloc_template deprecated...


Hello, 

We have some code that has been running on an old version of Linux for several years. 

Recently, we've purchased a new server, installed the latest Fedora core, and want to move the code onto the new server. 

When compiling the code, we get some strange errors about '__malloc_alloc_template' 

I'm really not an expert with the STL, but my guess is that the function name must have changed in the newer versions of gcc and libstdc++ 


>From what I understand, the specific call "__malloc_alloc_template" has been deprecated. Unfortunately, I don't know enough about C++ to replace it correctly. 

Hopefully someone can suggest a couple of "quick fixes" so that I can compile and run this code. 


The specific error looks like this: 
------------------------------------------------ 
../common/progs.c:69: error: '__malloc_alloc_template' was not declared in this scope 
../common/progs.c:69: error: template argument 4 is invalid 
../common/progs.c:69: error: expected ',' or '...' before '>' token 
../common/progs.c: In member function 'int URLExtractor::extractURLs(DataBlock&, int)': 
---------------------------------------------------- 

The code from line 69 is: 
------------------------------------------------ 
int extractURLs( DataBlock &content, map<void *, void *, less<void *>, __malloc_alloc_template<0> > &urls ){ 
------------------------------------------------- 

Additionally, we get similar errors from another piece of our code that look related to the same issue: 
---------------------------------------------- 
std::set< HASH64, less<HASH64>, __malloc_alloc_template<0> > *startURLs; 
----------------------------------------------- 


Can anybody offer some suggestions on how to fix this. (I imagine it's probably something simple like including an extra header or perhaps renaming the malloc call. But I'm not sure.) 

Thanks!! 

-N 



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