On Fri, Dec 23, 2016 at 3:48 AM, Jakub Jelinek <ja...@redhat.com> wrote:
> Hi!
>
> C++ says that C library functions are implicitly noexcept, except for those
> like qsort and bsearch where exceptions can be thrown from the callbacks.
>
> We handle this through cfns.gperf, but that contains only list of C89
> functions, while C++11 and C++14 refer to C99 and C++17 refers to C11.
>
> I went through the C99 and C11 standards, gathered all functions from there
> (not macros nor generic functions) and using gperf %struct-type feature
> attached the C version next to each symbol, so that e.g. snprintf is
> noexcept only with -std=c++11 and above and e.g. mbrtoc16 only with
> -std=c++17.  Without this, we still consider snprintf as potentially
> throwing, which breaks gimple-ssa-sprintf.c assumptions.  For -std=c++98
> snprintf is not considered a builtin.

Let's only be strict about this if flag_iso is set; for C library
usage it shouldn't usually matter what C++ standard we're using.

Jason

Reply via email to