[PATCH] These builtin functions set errno. Mark them accordingly.

hfinkel at anl.gov hfinkel at anl.gov
Mon Nov 24 12:23:09 PST 2014


We should perhaps reopen this in light of PR21635 (or consider some variant of it). The problem, as pointed out in the bug report, is that libstdc++ implements std::X in terms of __builtin_X:

  inline float
  exp(float __x)
  { return __builtin_expf(__x); }

and these C++ functions are *required* to follow the same math error handling protocol as the underlying C functions. So we actually don't have much of a choice here (at least for those functions used to implement libstdc++) as far as I can tell. As a result, this seems like the right approach after all (although this is somewhat unfortunate).

http://reviews.llvm.org/D3806






More information about the cfe-commits mailing list