[Bug c/13025] New: incorrect "might be used uninitialized in this function" warning (no, not the usual problem)
dgay at intel-research dot net
gcc-bugzilla@gcc.gnu.org
Wed Nov 12 17:26:00 GMT 2003
The attached file reports
foo.c: In function `main':
foo.c:19: warning: `result1' might be used uninitialized in this function
when compiled with avr-gcc -Os -Wall -c foo.c
gcc was built with
./configure --host=i686-pc-linux-gnu --enable-languages=c --target=avr --disable-nls
The same problem shows up in gcc-ss-3_3-20031110
foo.c:
char a;
static inline char rcombine(char r1, char r2)
{
return r1 ? 0 : r2;
}
static inline char Mod1_xx(void)
{
int i;
for (i = 0; i < 6; i++) a += i;
return 1;
}
static inline char Mod1_StdControl_init(void)
{
char result1;
char result2;
result1 = rcombine(2, 1);
result2 = Mod1_xx();
result1 = rcombine(result1, result2);
return result1;
}
int main(void)
{
Mod1_StdControl_init();
return 0;
}
--
Summary: incorrect "might be used uninitialized in this function"
warning (no, not the usual problem)
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dgay at intel-research dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13025
More information about the Gcc-bugs
mailing list