The #pragma is complier specified. for example, the code below does not work in gcc.

#pragma startup and #pragma exit:

#pragma startup func1
#pragma exit func2 void func1()
{
printf("Inside func1()\n");
} void func2()
{
printf("Inside func2()\n");
} int main()
{
printf("Inside main()\n"); return ;
}

in GCC, you can use

void __attribute__((constructor)) func1(); 
void __attribute__((destructor)) func2();  
 
#pragma warn Directive
in case there are some warning and you are sure it works as your expection and there is no any risk, you can use #pragma warn to disable it, but the code shall have a well document. 
#pragma warn +xxx (To show the warning)
#pragma warn -xxx (To hide the warning)
#pragma warn .xxx (To toggle between hide and show)
  • #pragma warn -rvl: This directive hides those warning which are raised when a function which is supposed to return a value does not return a value.
  • #pragma warn -par: This directive hides those warning which are raised when a function does not uses the parameters passed to it.
  • #pragma warn -rch: This directive hides those warning which are raised when a code is unreachable. For example: any code written after the return statement in a function is unreachable.

#pragma Directive in C/C++的更多相关文章

  1. 重新梳理HTML基础知识

    缘起 HTML(HyperText Markup Language超文本标记语言)是用于构建web页面的标记语言和通用标准.它并不是一项新的发明,因为超文本(具有超链接的文本)和标记语言(用于电子文档 ...

  2. C中的预编译宏定义

     可以用宏判断是否为ARC环境 #if _has_feature(objc_arc) #else //MRC #endif C中的预编译宏定义 -- 作者: infobillows 来源:网络 在将一 ...

  3. How do I place a group of functions or variables in a specific section?

    http://supp.iar.com/Support/?Note=27498 EWARM v5.xx (and newer) The placement of a few functions in ...

  4. RFC 2616

    Network Working Group R. Fielding Request for Comments: 2616 UC Irvine Obsoletes: 2068 J. Gettys Cat ...

  5. 基于NodeJs的网页爬虫的构建(一)

    好久没写博客了,这段时间已经忙成狗,半年时间就这么没了,必须得做一下总结否则白忙.接下去可能会有一系列的总结,都是关于定向爬虫(干了好几个月后才知道这个名词)的构建方法,实现平台是Node.JS. 背 ...

  6. scanf()常犯错误

    ------------------------------------------------------------------------ <> 本意:接收字符串. 写成代码:voi ...

  7. RFC2616-HTTP1.1-Header Field Definitions(头字段规定部分—单词注释版)

    part of Hypertext Transfer Protocol -- HTTP/1.1RFC 2616 Fielding, et al. 14 Header Field Definitions ...

  8. HTML5 Differences from HTML4

    Abstract "HTML5 Differences from HTML4" describes the differences of the HTML5 specificati ...

  9. C预编译, 预处理, C/C++头文件, 编译控制,

    在所有的预处理指令中,#Pragma 指令可能是最复杂的了,它的作用是设定编译器的状态或者是指示编译器完成一些特定的动作.#pragma指令对每个编译器给出了一个方法,在保持与C和C++语言完全兼容的 ...

随机推荐

  1. python 最小二乘拟合,反卷积,卡方检验

    import numpy as np # from enthought.mayavi import mlab ''' ogrid[-1:5:6j,-1:5:6j] [array([[-1. ], [ ...

  2. java编写本月日历

    代码如下: import java.time.*; public class Main { public static void main(String arg[]){ LocalDate date ...

  3. node连接myslq

    var mysql = require('mysql'); var connection = mysql.createConnection({ host : 'localhost', user : ' ...

  4. 深入理解java虚拟机---虚拟机工具jhat(十六)

    jhat JVM Heap Analysis Tool命令是与jmap搭配使用,用来分析jmap生成的dump,jhat内置了一个微型的HTTP/HTML服务器,生成dump的分析结果后,可以在浏览器 ...

  5. innerHTML和innerText的区别,以及select元素中怎么取出被选中的option。

    一.innerHTML和innerText的区别. 元素.innerHTML = 字符串,是将一对或一个标签所标识的内容全部替换为所赋予的字符串,如果字符串中有标签,浏览器将自动识别其中的标签. 元素 ...

  6. SharePoint Framework 企业向导(九)

    博客地址:http://blog.csdn.net/FoxDave 管理SPFx解决方案的容量 所有部署到租户的SPFx解决方案必须被租户管理员审批通过.这是通过上传SPFx包(.sppkg)到A ...

  7. HTC脚本介绍和入门示例

    一.简介 HTC脚本全称是Html Companent即html组件,个人认为它是为了在开发动态HTML中实现代码重用和页面共享目的,主要是把“行为”作为组件封装,可以在很大程度上简化DHTML的开发 ...

  8. 基于ArduinoLeonardo板子的BadUSB攻击实战

    0X00 前言 在Freebuf上许多同学已经对HID攻击谈了自己的看法,如维克斯同学的<利用Arduino快速制作Teensy BadUSB>无论从科普还是实践都给我们详尽的描述了Bad ...

  9. Python爬虫框架Scrapy实例(三)数据存储到MongoDB

    Python爬虫框架Scrapy实例(三)数据存储到MongoDB任务目标:爬取豆瓣电影top250,将数据存储到MongoDB中. items.py文件复制代码# -*- coding: utf-8 ...

  10. busybox 安装问题解决

    直接编译错误 1.loginutils/passwd.c:93:16: error: storage size of ‘rlimit_fsize’ isn’t known 解决方法:在busybox根 ...