首页 > 其他分享 >GCC-2——杂项汇总

GCC-2——杂项汇总

时间:2022-11-26 23:22:12浏览次数:60  
标签:__ non constant built int 汇总 GCC 杂项

1. __builtin_constant_p

它是GCC的内建函数,用于判断一个值是否为编译时常数,如果参数是常数,函数返回 1,否则返回 0。

#include <stdio.h>

#define MAX 10 //built in constant

int global = 10; //non built in constant

int * const p = NULL; //non built in constant

int test_func() //non built in constant
{
    return 0;
}

void main()
{
    if (__builtin_constant_p(p)) {
        printf("built in constant\n");
    } else {
        printf("non built in constant\n");
    }
}

 

标签:__,non,constant,built,int,汇总,GCC,杂项
From: https://www.cnblogs.com/hellokitty2/p/16928628.html

相关文章

  • Grasp Detection论文、代码汇总
    文章目录​​2022​​​​End-to-endTrainableDeepNeuralNetworkforRoboticGraspDetectionandSemanticSegmentationfromRGB​​​​2019​​​​AntipodalRob......
  • Knowledge Transfer论文、代码汇总
    文章目录​​2018​​​​LearningDeepRepresentationswithProbabilisticKnowledgeTransfer(ECCV)​​​​2019​​​​LIKEWHATYOULIKE:KNOWLEDGEDISTILLVIAN......
  • 近期运维开发机会汇总
    精品新闻定制,D轮融资,技术导向型公司,内部晋升机会大,背景实力强,五道口。职位:系统运维工程师工作职责:1、硬件设备选型与预算、带宽预算、IDC选型等2、Linux系统运维工作,包括:安......
  • 使用RPA机器人快速实现表格数据汇总
    不知道大家有没有遇到过重复的数据录入、同样格式的数据汇总、大型表格数据拆分等各种各样不是很难但超级浪费时间的工作,如果你有类似的烦恼,不妨看一下这篇文章。今天作者就......
  • cpp constexpr 类名推断(gcc需要7.3以上
    #include<iostream>#include<string_view>template<typenameT>structTypeName{constexprstaticstd::string_viewfullname_intern(){#ifdef......
  • gcc_预处理_编译_汇编_连接
    +------------------+|gcc-E||----------------->||---------------------------------+|gcc......
  • matlab带UI界面编译成可执行文件问题汇总
    **********************************mcc全部直接无法使用我是下载的matlabR2014a然后出现mcc无法使用(即,随便一个file.m进行编译成可执行文件mcc-mfile.m都报错)我根据以......
  • arm-linux-gcc把char定义为 unsigned char
    目录三者的关系char的定义参考文章三者的关系ANSIC提供了3种字符类型,分别是char、signedchar、unsignedchar。而不是像short、int一样只有两种(int默认就是unsigned......
  • Jenkins 问题汇总
    1.未安装MavenERROR:AMaveninstallationneedstobeavailableforthisprojecttobebuilt.EitheryourserverhasnoMaveninstallationsdefined,orthere......
  • 汇总:基于SSM封装的一个迅速开发项目的底层框架集成项目
    本章开始会记录封装的全过程,包括集成一些常用的框架工具集成、MVC架构的设计等(目录内容待更新……)下面就从零开始介绍开发的整个过程,首先先使用springboot创建maven项目,pom......