This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/6522] abort should not be marked noreturn


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]