This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/6522] abort should not be marked noreturn
- From: "schwab at suse dot de" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 17 Jun 2008 11:41:19 -0000
- Subject: [Bug libc/6522] abort should not be marked noreturn
- References: <20080515091307.6522.dak@gnu.org>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From schwab at suse dot de 2008-06-17 11:41 -------
Removing noreturn from abort will not eliminate the problem, the compiler will
still combine two calls if they appear in similar enough contexts. In the
following example the compiler will still generate only a single call to abort,
no matter how it is declared.
#include <stdlib.h>
int bar (int);
#ifdef USE_ABORT1
void abort1 (void);
#define abort abort1
#endif
int
foo (int a)
{
int b;
if (a == 1)
{
b = bar (a);
if (!b) abort ();
}
else if (a == 2)
{
b = bar (a + 1);
if (!b) abort ();
}
else
b = a;
return b;
}
--
http://sourceware.org/bugzilla/show_bug.cgi?id=6522
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.