linux gcc 预编译
来源:互联网 发布:餐饮业进销存软件 编辑:程序博客网 时间:2024/04/28 01:38
linux gcc 预编译
命令:gcc -E test.c -o test.i
预编译主要完成以下功能:
1.删除所有的注释“//”和“/**/”;
2.删除所有的“#define”,展开所有的宏定义;
3.处理所有的条件预编译指令;
4.处理“#include”预编译指令,将被包含的文件插入到该预编译指令的位置,这一过程是递归进行的;
5.添加行号和文件名标识;
例:
源文件(test.c)如下:
#include <stdio.h>
#define MY_SIZE 1000000
//this is a test
/*this
is
a
test
!
*/
int main(int argc,char* argv[])
{
char *test=NULL;
while(1)
{
test = NULL;
test = new char[MY_SIZE];
if(test == NULL)
{
printf("I am wrong/n");
break;
}
printf("a../n");
}
printf("I am ok!/n");
return 0;
}
预编译后文件内容(test.i)如下:
。。。//此处略过一大段头文件插入内容
extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ;
extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
# 850 "/usr/include/stdio.h" 3 4
# 2 "abc.c" 2
# 13 "abc.c"
int main(int argc,char* argv[])
{
char *test=((void *)0);
while(1)
{
test = ((void *)0);
test = new char[1000000];
if(test == ((void *)0))
{
printf("I am wrong/n");
break;
}
printf("a../n");
}
printf("I am ok!/n");
return 0;
}
- linux gcc 预编译
- gcc 预编译控制
- GCC 预编译
- gcc中的预编译宏
- gcc中的预编译宏
- gcc中的预编译宏
- linux, windows, mac, ios等平台GCC预编译宏判断
- linux, windows, mac, ios等平台GCC预编译宏判断
- linux, windows, mac, ios等平台GCC预编译宏判断
- 浅谈GCC预编译头技术
- 使用gcc的预编译头文件
- 浅谈GCC预编译头技术
- 浅谈GCC预编译头技术
- GCC使用技巧之预编译
- GCC中使用预编译头文件
- GNU编译器:gcc中的预编译宏
- GNU编译器:gcc中的预编译宏
- 浅谈GCC预编译头技术
- 初始化及engine
- 陆地
- 调整我的ubuntu显示器分辨率(显卡:SiS661FX)
- mini草
- exe传递参数
- linux gcc 预编译
- 够烂的newton
- oracle exp EXP-00003: 未找到段 (12,11) 的存储定义
- ORA-00054
- Linux RHEL XEN 安装
- 各种C/C++
- TFT
- 检查PC是否安装NET Framework
- 轮回 ---- 写给龙葵