built-in function 'exp' declared as non-function

Jonathan Wakely jwakely.gcc@gmail.com
Thu Apr 11 17:06:00 GMT 2019


On Thu, 11 Apr 2019 at 18:01, phi gcc <phi.gcc@gmail.com> wrote:
>
> Builtin symbols should be namespaced
> __exp()
>
> and he one who want the builtin short named could (and I guess the
> include math.h) can do that.
>
> #define exp __exp
>
> There is no problem of renaming it because as a user you will never
> set a BP into the builtin.
>
> With the reversed logic, compilers (or normalisation I guess)
> despotically pick a stdlib function name, decide it become a builtin,

No, the language standard picked the name, and reserves "exp" as an
identifier with external linkage if you use any stdlib entity. So
defining another entity with that name and external linkage has
undefined behaviour.



More information about the Gcc-help mailing list