This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/13025] New: incorrect "might be used uninitialized in this function" warning (no, not the usual problem)
- From: "dgay at intel-research dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Nov 2003 17:26:15 -0000
- Subject: [Bug c/13025] New: incorrect "might be used uninitialized in this function" warning (no, not the usual problem)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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