On Wed, 7 Jun 2017, Bernhard Reutner-Fischer wrote: > It's like optimizing foo() to a random built-in but maybe that's just > me. If your libc provides a define to a standard function for these > under a compat knob then fine but otherwise you should fix that. > *shrug*. Joseph?
It's the usual thing of: if the -std option enables a function as built-in it can be assumed to have certain semantics if called (this does *not* mean it's appropriate to generate calls to it from code that called other functions, as the library might not have it at all; that's for the libc_has_function hook to specify). Otherwise (-std=c11 etc. options) semantics cannot be assumed based on the name (they still can for __builtin_*) - but in principle it may be OK to assume semantics for a function whose name is reserved in the relevant C standard version, or if an explicit declaration came from a system header (which would generally be the case for e.g. -std=c99 -D_POSIX_C_SOURCE=whatever). -- Joseph S. Myers jos...@codesourcery.com