欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: 大家幫看看為什么C語言全局變量會有警告呢 [打印本頁]

作者: i66580    時間: 2020-4-11 23:02
標題: 大家幫看看為什么C語言全局變量會有警告呢
#include "stc8.h"
#include "intrins.h"
#include "lcd_lite.h"
#include  "mhz.h"
#include "3231.h"
#include "h.h"
         


        int count1=0;
        int secondss=0;
        
                        

void main(){
//fountion('s',y,m,d,w,h,mi,s);
int y=20;
int m=4;
int d=11;
int w=6;
int h=21;
int mi=32;
int s=30;
        

init();
        
P14=0;
Time0_Init();
show();



        
        
while(1){
EA = 0;

if(P53==0)
{fountion('s',y,m,d,w,h,mi,s);}



fountion('r',20,3,4,3,12,10,50);
LCDnum2(2,get_time(3));//week

LCDnum2(6,get_time(6));//data
LCDnum2(10,get_time(5));
LCDnum2(14,get_time(4));

LCDnum2(2+0x40,get_time(2));//time
LCDnum2(6+0x40,get_time(1));
LCDnum2(10+0x40,get_time(0));


        
LCDnum4(12+0x40,count1);

if(get_time(0)!=secondss){count1++;if(count1>2400)count1=0;secondss=get_time(0);}

EA = 1;}}



警告如下

Rebuild started: Project: lite
Rebuild target 'Target 1'
assembling STARTUP.A51...
compiling main.c...
compiling 3231.c...
compiling delay.c...
compiling lcd_lite.c...
compiling mhz.c...
linking...
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
    SEGMENT: ?C_INITSEG
Program Size: data=78.0 xdata=0 code=2274
creating hex file from "lite"...
"lite" - 0 Error(s), 1 Warning(s).
Build Time Elapsed:  00:00:00



請大家幫幫忙謝謝!


作者: csmyldl    時間: 2020-4-12 09:51
L16的警告不是涉及全局變量,而是未用到的子函數,不影響程序運行
作者: panda_aron    時間: 2020-4-12 09:52
一般全局變量的警告是因為你定義的全局變量沒有被包含,比如我在key.c里定義了一個全局變量,那么我在main里如果想要用這個變量就需要在開頭加上#include"key.h",并且在key.h里添加上全局變量的定義
作者: xxpp2011    時間: 2020-4-12 10:02
某個函數定義了沒有調用到
作者: 火神浪客行    時間: 2020-4-13 10:53
這個警告不影響你正常使用,要消除把沒用到的子函數注釋掉就好了




歡迎光臨 (http://m.raoushi.com/bbs/) Powered by Discuz! X3.1