#pragma GCC system_header用法
在看公司公共库的头文件中发现了:#pragma GCC system_header一行,以前没有见过这种用法,在网上查了一下,解释如下:
从#pragma GCC system_header直到文件结束之间的代码会被编译器视为系统头文件之中的代码。系统头文件中的代码往往不能完全遵循C标准, 所以头文件之中的警告信息往往不显示。(除非用 #warning显式指明)。
可以查看gcc参考手册:http://gcc.gnu.org/onlinedocs/cpp/System-Headers.html#System-Headers
The header files declaring interfaces to the operating system and runtime libraries often cannot be written in strictly conforming C. Therefore, GCC gives code found in system headersspecial treatment. All warnings, other than those generated by ‘#warning’ (see Diagnostics), are suppressed while GCC is processing a system header. Macros defined in a system header are immune to a few warnings wherever they are expanded. This immunity is granted on an ad-hoc basis, when we find that a warning generates lots of false positives because of code in macros defined in system headers.
Normally, only the headers found in specific directories are considered system headers. These directories are determined when GCC is compiled. There are, however, two ways to make normal headers into system headers:
- Header files found in directories added to the search path with the -isystem and -idirafter command-line options are treated as system headers for the purposes of diagnostics.
- There is also a directive,
#pragma GCC system_header, which tells GCC to consider the rest of the current include file a system header, no matter where it was found. Code that comes before the ‘#pragma’ in the file is not affected.#pragma GCC system_headerhas no effect in the primary source file.
#pragma GCC system_header用法的更多相关文章
- 【转】各个层次的gcc警告 #pragma GCC diagnostic ignored "-Wunused-parameter" --不错
原文网址:http://blog.csdn.net/lizzywu/article/details/9419145 各个层次的gcc警告从上到下覆盖 变量(代码)级:指定某个变量警告 int a __ ...
- 编译器处理警告、错误 #pragma GCC diagnostic ignored "-Wunused"
各个层次的gcc警告从上到下覆盖 变量(代码)级:指定某个变量警告 int a __attribute__ ((unused));指定该变量为"未使用的".即使这个变量没有被使用, ...
- gcc基本用法
GCC基本用法 GCC最基本的用法是: gcc [option] filenames option:编译器所需要的编译选项 filenames:要编译的文件名 gcc编译流程 都以 hello.c 为 ...
- gcc编译器用法
一个用c语言写的程序把他编译成计算机可执行的文件,一般有4个步骤 /*================================================================ ...
- gcc编译器用法(自学总结)
GCC仅仅意味着GNU C Compiler. gcc工作四个步骤:预处理,编译,汇编,连接. 1.预处理: 编译器将C源代码中的包含的头文件如stdio.h编译进来,用户可以使用gcc的选项&quo ...
- 关于pragma pack的用法(一)
一个很重要的参数#pragma pack(n) 数据边界对齐方式:以如下结构为例: struct { char a; WOR ...
- IOS笔记 #pragma mark的用法
简单的来说就是为了方便查找和导航代码用的. 下面举例如何快速的定位到我已经标识过的代码. #pragma mark 播放节拍器 - (void) Run:(NSNumber *)tick { //.. ...
- (转)IOS笔记 #pragma mark的用法
简单的来说就是为了方便查找和导航代码用的. 下面举例如何快速的定位到我已经标识过的代码. #pragma mark 播放节拍器 - (void) Run:(NSNumber *)tick{ ...
- #pragma的一些用法
1.#pragma message message 参数:Message参数能够在编译信息输出窗口输出相应的信息,这对于源代码的信息控制特别重要,其使用方法为: #pragma message(&qu ...
随机推荐
- An application icon
The application icon is a small image which is usually displayed in the top left corner of the title ...
- Gulp构建前端自动化工作流之:常用插件介绍及使用
在对Gulp有了一个初步的了解之后,我们开始构建一个较为完整的Gulp开发环境. 本文主要分为6个段落: 1. 构建项目目录结构(Directory Structure Build) 2. 插件介绍及 ...
- javascript实现掉落弹出层------Day29
顾名思义.所谓"掉落弹出层".就是出现一个弹出层,而出现的位置是从上方向下掉落.掉落到指定的位置停止,这样分析起来.和"右下角弹出提醒对话框"比起来,确有异曲同 ...
- webservice系统学习笔记6-使用soap的header传递消息
1.显示的使用soap的header传递消息(不推荐使用,会破坏正常的代码结构,推荐使用handler处理) @WebResult(name="deleteResult") pub ...
- 19、java内存分配 常量池详解
在class文件中,“常量池”是最复杂也最值得关注的内容. Java是一种动态连接的语言,常量池的作用非常重要,常量池中除了包含代码中所定义的各种基本类型(如int.long等等)和对象型(如Stri ...
- /etc/fstab 参数详解(转)
转自:http://blog.csdn.net/duyiwuer2009/article/details/8644753/ /dev/hda5 /home/new ...
- Q1:Valid Parentheses
Question: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine i ...
- DevExpress GridControl 动态创建字段及主细关系表过程
原文地址:http://hi.baidu.com/qdseashore/item/38f1153e9d0143637d034b7a 在做项目中,往往需要在查询基类模板窗口内做主细关系Grid,引用一下 ...
- Oracle创建库
oracle创建表空间 SYS用户在CMD下以DBA身份登陆: 在CMD中打sqlplus /nolog 然后再 conn / as sysdba --如果路径不存在则要创建路径 --创建临时表空间 ...
- HDUOJ----(4788)Hard Disk Drive
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission ...