keil5编译器优化问题
发布日期:2021-06-20 21:45:22 浏览次数:6 分类:技术文章

本文共 368 字,大约阅读时间需要 1 分钟。

同样的程序,dev c可以很好执行,keil5却出问题。

#include "stdio.h" int main(){
int n = 15; int qtiB = 0; while(n>0) {
if(n%2) {
qtiB = qtiB*10+1; } n = n/2; } printf("%d", qtiB);}
num = qtis/2;			while(num>0)			{
if(num%2 != 0) {
qtiB = qtiB*10+1; } num = num/2; } UARTprintf("qti:%d\n",qtiB);

在这里插入图片描述

问题定位于qtiB = qtiB*10+1;这句话。
猜测由于keil5对代码进行优化导致的。

转载地址:https://blog.csdn.net/I_LOVE_MCU/article/details/100112193 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:树莓派40pin管脚图
下一篇:#1295-D: Deprecated declaration I2C_Start - give arg types

发表评论

最新留言

不错!
[***.144.177.141]2024年03月28日 08时35分56秒