#include <stdio.h>
#define N 100
void f(void);
int main(void)
{
f();
#ifdef N
#undef N
#endif
return 0;
}
void f(void){
#if defined(N)
printf("N is %d\n",N);
#else
printf("N is undefined\n");
#endif // defined
}
为什么这个输出打印N是未定义的,为什么它不应该打印N为100,因为它在到达删除值100的undef之前对f进行了
编译( C)中的目标是如何工作的?我正在做一个项目,但在那个#error You have to define a target in your compiler project properties.上失败了
我想知道汇编的确切目标是什么,以及它是如何工作的。
我的编译器是GCC
编辑
这是我的错误:In file included from ../../../RefFT/Common/src/SIGPROC_COMMON_ippdefs.h:55:0, from ../../../RefFT/Common/src/SIGPROC_COMMON_memory_alloc.c:36: ../.
我正在用C语言编写一个程序,它可以在HP NonStop机器上编译和运行。但是,我想在我的运行Linux的工作站上进行主要的开发。HP NonStop C编译器需要非标准的#include指令,如下所示:
#include <stdio.h> nolist
对于每个#include指令,我的工作站的GCC都在抱怨:
S88USF.c:139:21: warning: extra tokens at end of #include directive
我如何才能抑制这个特殊的警告呢?
注:在这种情况下,类似的问题已经被问到了,正确的答案是“不要给gcc任何抱怨的理由”。然而,在这个场
我有一个函数,它将指向函数的指针作为参数。函数在for循环中调用,因为函数指针的名称具有类似的性质,所以我使用宏将名称展开到函数中。看起来是这样的:
void fill(int, int(*funcbase)(int));
int funcbase0(int);
int funcbase1(int);
int funcbase2(int);
int funcbase3(int);
/// all the way through funcbase31
#define FILL_(num) fill(num, funcbase##num)
#define FILL(num) FILL_(num)