栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

C:glibc:

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

C:glibc:

文章目录
  • 解释

解释

/stdlib/isomac.c
这是一个精心设计的程序,用来检查系统头文件中的“非法宏定义”。 什么是非法的宏定义:

  • 不是出自实现域内的,例如,没有以下划线开始的
  • 不是标准定义的宏。
  • 例外情况,就是以E开头的,可能是errno.h里的定义。
  • 例外情况,以_MAX 结尾,参考下面的 前缀后缀总结。
   In a compliant implementation no other macros can be defined, because you could write strictly conforming programs that may fail to compile due to syntax errors: suppose  defines PIPE_BUF, then the conforming

   #include 
   #include       <- or where the bogus macro is defined
   #include 
   #define STR(x) #x
   #define XSTR(x) STR(x)
   int main (void)
   {
     int PIPE_BUF = 0;   、、、如果真有问题,也是在这一行现有编译错误。目前的版本是这样
     assert (strcmp ("PIPE_BUF", XSTR (PIPE_BUF)) == 0);   、、、、 这个例子有点老了,现在stdio.h里没有了PIPE_BUF
     return 0;
   }

   is expected to compile and meet the assertion. If it does not, your compiler compiles some other language than Standard C.

   REQUIREMENTS:
     This program calls gcc to get the list of defined macros. If you
     don't have gcc you're probably out of luck unless your compiler or
     preprocessor has something similar to gcc's -dM option. Tune
     PRINT_MACROS in this case. This program assumes headers are found
     under /usr/include and that there is a writable /tmp directory.
     Tune SYSTEM_INCLUDE if your system differs.
     #define BROKEN_SYSTEM if system(NULL) bombs -- one more violation
     of ISO C, by the way.

   OUTPUT:
     Each header file name is printed, followed by illegal macro names
     and their definition. For the above example, you would see
     ...
     /usr/include/stdio.h
     #define PIPE_BUF 5120
     ...
     If your implementation does not yet incorporate Amendment 1 you will see messages about iso646.h, wctype.h and wchar.h not being found.  */

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/657504.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号