Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#262 Fails to compile with clang: use_safe_malloc_instead

consensus
open
Brian Walenz
None
5
2014-04-11
2013-11-08
Shaun Jackman
No

Compiling with clang gives the following error:

```
In file included from AS_BOG_ChunkGraph.C:24:
In file included from /private/tmp/celera-assembler-IlFU/wgs-8.0/src/AS_BOG/AS_BOG_Datatypes.H:36:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iostream:40:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/istream:156:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:938:33: error: use of undeclared identifier 'use_safe_malloc_instead'
wb = (_CharT*)malloc(len*sizeof(_CharT));
^
/private/tmp/celera-assembler-IlFU/wgs-8.0/src/AS_UTL/AS_UTL_alloc.H:55:23: note: expanded from macro 'malloc'

define malloc(X) use_safe_malloc_instead(X)

                  ^

```

Discussion

  • Brian Walenz
    Brian Walenz
    2014-04-11

    I can't say clang compilation works yet, at least from the command line, but this problem is resolved. Remove the include of iostream, cmath and limits from AS_BOG/AS_BOG_Datatypes.H. The change is committed to subversion. (Odd that c++ ostream uses malloc, no?)

    For the record, clang compilation fails to find header omp.h.

     
  • Brian Walenz
    Brian Walenz
    2014-04-11

    • assigned_to: Brian Walenz