SourceForge has been redesigned. Learn more.
Close

#246 malloc.h doesn't declare _aligned_malloc if windows.h

closed-duplicate
nobody
header (101)
5
2014-08-17
2011-10-12
No

malloc.h doesn't declare _aligned_malloc/_aligned_free if windows.h is included first.

See attached example:

$ x86_64-w64-mingw32-gcc -Wall -o aligned_malloc aligned_malloc.c
aligned_malloc.c: In function ‘main’:
aligned_malloc.c:5:2: warning: implicit declaration of function ‘_aligned_malloc’ [-Wimplicit-function-declaration]
aligned_malloc.c:5:12: warning: initialization makes pointer from integer without a cast [enabled by default]
aligned_malloc.c:6:2: warning: implicit declaration of function ‘_aligned_free’ [-Wimplicit-function-declaration]

The issue seems to be related to _MM_MALLOC_H_INCLUDED being defined in intrin.h which is included indirectly by windows.h.

But I'm not sure what's the best way to fix this....

Discussion

  • Jose Fonseca

    Jose Fonseca - 2011-10-12

    test case

     
  • Kai Tietz

    Kai Tietz - 2012-01-21

    Duplicate of _aligned_malloc

     
  • Kai Tietz

    Kai Tietz - 2012-01-21
    • status: open --> closed-duplicate
     

Log in to post a comment.