This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/24239] spurious warning about clobbered variables w.r.t. longjmp
- From: "dvilleneuve at kronos dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Oct 2005 12:28:10 -0000
- Subject: [Bug middle-end/24239] spurious warning about clobbered variables w.r.t. longjmp
- References: <bug-24239-10957@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from dvilleneuve at kronos dot com 2005-10-11 12:28 -------
Indeed, in gcc-4.0.1, the previous code chunk does not elicit a warning.
However, a slightly modified version still gets a warning (tested
on RHEL-4, with <gcc version 4.0.1 20050727 (Red Hat 4.0.1-4.EL4.2)>).
<c-code>
#include <setjmp.h>
extern int f(void);
extern int g(int);
extern jmp_buf jb;
extern int i;
int f(void)
{
int j;
if( i > 10 ) j = i;
else j = i + 10;
if( !setjmp(jb) ) {
g(j);
}
else {
j = -1;
}
return j;
}
</c-code>
--
dvilleneuve at kronos dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Version|3.4.4 |4.0.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24239