其他分享
首页 > 其他分享> > C:glibc:_ISOMAC 这个是什么意思?ISO macro,ISO定义的宏

C:glibc:_ISOMAC 这个是什么意思?ISO macro,ISO定义的宏

作者:互联网

文章目录

解释

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

   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 <stdio.h> defines PIPE_BUF, then the conforming

   #include <assert.h>
   #include <stdio.h>      <- or where the bogus macro is defined
   #include <string.h>
   #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.  */

标签:定义,macro,glibc,PIPE,ISO,include,BUF,your,define
来源: https://blog.csdn.net/qq_36428903/article/details/121889624