在编写程序的时候,我们经常要用到#pragma指令来设定编译器的状态或者是指示编译器完成一些特定的动作。

MSDN:

Each implementation of C and C++ supports some features unique to its host machine or operating system. Some programs, for instance, need to exercise precise control over the memory areas where data is placed or to control the way certain functions receive parameters. The #pragma directives offer a way for each compiler to offer machine- and operating system-specific features while retaining overall compatibility with the C and C++ languages. Pragmas are machine- or operating system-specific by definition, and are usually different for every compiler.

Pragmas can be used in conditional statements, to provide new preprocessor functionality, or to provide implementation-defined information to the compiler.

If the compiler finds a pragma it does not recognize, it issues a warning, but compilation continues.

Some pragmas provide the same functionality as compiler options. When a pragma is encountered in source code, it overrides the behavior specified by the compiler option.

转载于:https://www.cnblogs.com/taoxu0903/archive/2009/03/02/1401390.html

Pragma Directives相关推荐

  1. VC中的宏 (#define) 与预处理 (#if/#ifdef/#pragma) 的使用方法总结。

    C/C++ 预定义宏 例子:C/C++ 预定义宏的取值 C/C++ 预定义宏用途:诊断与调试输出 CRT 的诊断与调试输出:assert, _ASSERT/_ASSERTE, _RPTn/_RPTFn ...

  2. Pragma是什么?

    Pragma是什么? Pragma是什么? 翻译:SkyJacker 后附英文原文. (译者注: 一句话,pragma就是为了让编译器编译出的C或C++程序与机器硬件和操作系统保持完全兼容而定义的宏扩 ...

  3. 编译指令#pragma详解

    源地址:http://www.ccrun.com/article.asp?i=639&d=n55u33 With #pragma, C++Builder can define the dire ...

  4. 编译指示_#pragma在DSP中的编程技巧

    转载自:https://blog.csdn.net/ranyeliang/article/details/102454462 编译指示(Pragma Directives)可能是所有的预处理指令中最复 ...

  5. MicroChip C18编译器上手及环境设置

    C18是MCHP老早针对PIC18高端片子自己出的编译器环境,可能是用户覆盖面的原因,个人感觉比PIC16上的Hi-tech PICC要难用很多. 针对不同的单片机要安装不同升级包,因为官方的头文件支 ...

  6. linux(07)之内核系统调用

    Linux(07)之内核系统调用 Author:Once Day Date:2023年1月7日 漫漫长路,才刚刚开始- 文章目录 Linux(07)之内核系统调用 1.概述 2. 系统调用 2.1 无 ...

  7. Hooks(钩子)监听消息的方法

    Hooks(钩子) 一.MSDN:索引Hooks A hook is a point in the system message-handling mechanism where an applica ...

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

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

  9. pragma指令简介

    在编写程序的时候,我们经常要用到#pragma指令来设定编译器的状态或者是指示编译器完成一些特定的动作. 下面介绍了一下该指令的一些常用参数,希望对大家有所帮助! 一. message 参数. mes ...

  10. Swift中的#pragma mark?

    本文翻译自:#pragma mark in Swift? In Objective C, I can use #pragma mark to mark sections of my code in t ...

最新文章

  1. K项目轶事之被客户通报批评
  2. 【数据竞赛】5行代码提升GBDT,提升巨大!
  3. Hibernate中常见的异常
  4. 阿里如何应对亿级高并发大流量?如何保障高可用和稳定性!
  5. 【DP】奖励卡(jzoj 3937)
  6. WPJAM网址导航:最轻便快捷的WordPress网址导航插件
  7. 3.15 晚会—「饿了么」之殇
  8. .class与.java_Java中Class类的作用与深入理解
  9. matlab+sfm+样例,基于SFM的三维重建MATLAB程序
  10. potato电脑版连接不上_土豆电脑版-potato chat下载 v2.13.200323 电脑版 - 安下载
  11. swiper(轮播图)基本使用
  12. 软件质量管理-6-质量管理
  13. Python 面试问题总结
  14. W10的AndroidStudio4.0.1的下载安装与配置
  15. caffe 人脸识别
  16. oracle数据库工程师的工资,数据库开发工程师工资待怎么样
  17. 使用Unity3D50个技巧-50 Tips for Working with Unity (Best Practices)
  18. 微信点餐小程序怎么做?微信小程序点餐系统制作
  19. 华为云mysql端口号_远程连接华为云数据库(端口3306)
  20. log4jdbc-log4j2浅析(sqlfx客户端采集日志的来源)-java 输出sql执行时间

热门文章

  1. Android 四大组件学习之BroadcastReceiver三
  2. findContours函数参数详解
  3. HTML5方式使用freeswitch——VERTO模块
  4. A - 敌兵布阵(线段树)(单点更新区间求和)
  5. 16.最接近的三数之和
  6. 利用ArcGIS Python批量拼接遥感影像(arcpy batch processing)
  7. C语言编写程序11到20的和,C语言编程 菜鸟练习100题(11-20)
  8. 华为ospf配置命令_教你使用华为Ensp模拟器配置OSPF路由协议(一)
  9. c语言pow函数原型_c语言中pow函数的用法是什么?
  10. python中configparser详解_Python 解析配置模块之ConfigParser详解