我正在使用 Intel 的 Compiler 13.1 在 Mac OS X 10.7.3 上编译 FFTW 3.1.2,在 align.c 中出现以下错误:
ifftw.h(122): warning #147: declaration is incompatible with "void *alloca(size_t={__darwin_size_t={unsigned long}})" (declared at line 36 of "/usr/include/alloca.h")
void *alloca(size_t);
^
ifftw.h(154): catastrophic error: #error directive: sizeof void* is unknown!
# error sizeof void* is unknown!
^
配置脚本将其设置为零,并且 config.h 文件包含:
#define SIZEOF_VOID_P 0
即使我将其注释掉,我仍然会收到错误消息。该错误由 ifftw.h 和以下代码强制转换:
#ifndef HAVE_UINTPTR_T
# if SIZEOF_VOID_P == 0
# error sizeof void* is unknown!
# elif SIZEOF_UNSIGNED_INT == SIZEOF_VOID_P
typedef unsigned int uintptr_t;
# elif SIZEOF_UNSIGNED_LONG == SIZEOF_VOID_P
typedef unsigned long uintptr_t;
# elif SIZEOF_UNSIGNED_LONG_LONG == SIZEOF_VOID_P
typedef unsigned long long uintptr_t;
# else
# error no unsigned integer type matches void* sizeof!
# endif
#endif
所以看起来void指针的大小不应该为零,但在我的情况下。在 Linux 上编译代码时并非如此。这里有什么问题?