Keil编译时报“extended constant initialiser used”警告

今天在使用Keil编译工程的时候强转指针类型会报 warning: #1296-D: extended constant initialiser used
警告处代码如下

void bsp_UsartClockDisable(USART_TypeDef* USARTx)
{configASSERT(USARTx);switch ((uint32_t)USARTx) {case (uint32_t)USART1 :case (uint32_t)USART6 :RCC_APB2PeriphClockCmd(bsp_GetUsartClock(USARTx),DISABLE);break;case (uint32_t)USART2 :case (uint32_t)USART3 :case (uint32_t)UART4 :case (uint32_t)UART5 :case (uint32_t)UART7 :case (uint32_t)UART8 :RCC_APB1PeriphClockCmd(bsp_GetUsartClock(USARTx),DISABLE);break;default:break ;}
}

问题出在(uint32_t)USART2强转指针类型这里,查阅RVDK_Compiler_Guide_B.pdf,可以看到跟C语言拓展有关

打开keil查看果然GUN extensions被勾上了

取消勾选点OK然后重新编译问题解决
如果没解决请参考:https://filon.blog.csdn.net/article/details/121465227?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EOPENSEARCH%7EHighlightScore-1.queryctrv2&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EOPENSEARCH%7EHighlightScore-1.queryctrv2&utm_relevant_index=1

Keil编译时报“extended constant initialiser used”警告相关推荐

  1. keil编译c语言检测,keil c中没有使用到的函数会编译时候会有警告

    想写一个模块,模块里面有我常用的一些功能函数,比如: a.h文件 #ifndef _a_h_ #define _a_h_ extern void one(void); extern void two( ...

  2. 【Keil编译警告】warning C316:unterminated conditionals

    [Keil编译警告]warning C316:unterminated conditionals Keil编译警告 warning C316:unterminated conditionals 可能某 ...

  3. Keil编译出错:“no source“: Warning: #2774-D: ‘=‘ assumed following macro name “USE_STDPERIPH_DRIVER“ in

    Keil今天编译出现了如下图所示问题: 警告一模一样,总共43个,最后找了大半天原因,问题出在Option--C/C++--Preprocessor Symbols--Define设置有问题. 我用的 ...

  4. keil编译时,提示function “xxx“ declared implicitly错误解决办法

    当keil编译时,出现function "USART3_Config" declared implicitly错误,意思是存在隐式申明,也就是在申明头文件或者函数名的时候存在一定的 ...

  5. 【Qt】新安装的虚拟机,使用QtCreator第一次编译时报错:g++: Command not found

    1.问题描述 新安装的虚拟机,使用QtCreator第一次编译时报错:g++: Command not found (或着报,make执行失败之类的错误) 2.原因分析 新安装的虚拟机中,没有g++. ...

  6. caffe中在某一层获得迭代次数的方法以及caffe编译时报错 error: ‘to_string‘ is not a member of ‘std‘解决方法

    caffe中在某一层获得迭代次数的方法以及caffe编译时报错 error: 'to_string' is not a member of 'std'解决方法 参考文章: (1)caffe中在某一层获 ...

  7. KEIL编译stdarg处理机制遇到incorrect use之类的问题

    文章转自:https://blog.csdn.net/chengdong1314/article/details/74625528 SYD8801是一款低功耗高性能蓝牙低功耗SOC,集成了高性能2.4 ...

  8. Keil编译报错:Cannot open include file: 'stdbool.h': No such file or directory问题解决

    Keil编译出现报错:Cannot open include file: 'stdbool.h': No such file or directory,或者出现Error: L6411E: No co ...

  9. pthread_create函数编译时报错:undefined reference to 'pthread_create'

    错误: pthread_create函数编译时报错:undefined reference to 'pthread_create' pthread_create()和pthread_atfork()函 ...

最新文章

  1. 【Web安全】关于PHP-文件上传的探索(看不懂你来打我)
  2. spring基于注解的IOC以及IoC的案例——概念
  3. Echarts与Highcharts的比较
  4. anaconda如何更改环境配置_Anaconda环境配置2020-08-27
  5. CentOS7 使用firewald
  6. 将整张网页存成png图片
  7. 的it生活_IT行业是干啥的
  8. linux进行硬盘分区挂载-了解系统,最更好的开发
  9. CSS让同一行文字和输入框对齐
  10. 【原】iphone6来了,我该做点什么(兼容iphone6的方法)
  11. s7200cpu224xp手册_西门子S7-200CPU224XP
  12. 荣耀 android 5.0 root,华为荣耀畅玩5C获取EMUI5.0 安卓7.0系统的root教程
  13. 云计算安全需求分析与网络
  14. DNS的作用是什么?为什么一定要配置DNS才能上网
  15. ​力扣解法汇总904.水果成篮
  16. 大连商务英语考试中心百家外语商务英语的特点及翻译方法
  17. Linux用户层和内核文件读写
  18. DAX:LOOKUPVALUE 函数
  19. 引用 神奇的象数疗法
  20. 二本跨考985计算机考研,跨专业考研经验谈:从二本到985的飞跃

热门文章

  1. word中水印无法显示
  2. ArcMap|以表格显示分区统计 ERROR:999999 解决方法
  3. implode 和 explode
  4. Sql Server exec sp_executesql
  5. lordoftheroot
  6. 源于魔兽!《植物大战僵尸》成功奥秘 (转)
  7. 页面内容,保存为TXT,下载到电脑
  8. C# Web Api接口返回结果为标准json格式
  9. 基于Java的聊天系统设计
  10. 平衡二叉树之AVL树的旋转