Erroneous compiler warnings in NNDK Rel23 RC7a
Posted: Sun Aug 16, 2009 11:14 pm
I am getting some warnings for errors which don't exist.
For example in this function it warns me that iLed is an unused variable Yet it is clearly assigned in the initialisation of the 'for' loop and accessed in the body.
In this function it reports that 'n' may be an uninitialised variable Even though I have used an explict assignment on line 11.
For example in this function it warns me that iLed is an unused variable Yet it is clearly assigned in the initialisation of the 'for' loop and accessed in the body.
Code: Select all
// Clear Screen to background colour
void CPanelCfg::ClearScreenBg()
{
int iLed ;
long offset ;
for(int driver = 0, iLed = 0 ; driver < iPanels ; driver++, iLed+=(iLedsPerPanel*3)) {
offset = HEADER_DL + ((long)iLed * IVALSIZE) ;
for(int i = 0 ; i < iLedsPerPanel ; i++, offset += IVALSIZE) {
// Set the background colour at the point
pDst->SetAt(offset+iBitOffsetR, bg.r) ;
pDst->SetAt(offset+iBitOffsetG, bg.g) ;
pDst->SetAt(offset+iBitOffsetB, bg.b) ;
}
}
}
Code: Select all
void CMemAppend::Dump()
{
BYTE *p = GetBuffer() ;
int e = (int)GetSize() ;
int n ;
int ll = 0x0F ;
char ch ;
printf("CMemAppend::Dump()\n") ;
n = 0 ;
for(int i = 0 ; i < e ; i++, p++) {
n = i & ll ;
if(n == 0)
printf("%04X:", i) ;
ch = *p ;
if(ch >= 0x20 && ch < 0x7f) {
printf("%c", ch) ;
} else {
printf("(%02x)", (int)ch) ;
}
if(n == ll)
printf("\n") ;
}
if(n != ll)
printf("\n") ;
}