Each function signature from the C standard library declared with external linkage is reserved to the implementation for use as a function signature with both extern "C" and extern "C++" linkage, or as a name of namespace scope in the global namespace.
with both extern "C" and extern "C++" linkage
or as a name of namespace scope in the global namespace
BTW, how can a function signature be used as a name?
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-discussion+unsubscribe@isocpp.org.
To post to this group, send email to std-dis...@isocpp.org.
Visit this group at https://groups.google.com/a/isocpp.org/group/std-discussion/.
I agree that the wording of this sentence is confusing. I would be surprised if they intended that you cannot declare a function called, say, printf, inside namespace xskzxr. I think you can open up an editorial issue on Github to fix the wording.
On Sun, Jun 17, 2018 at 11:33 PM, xskxzr <xsk...@gmail.com> wrote:
BTW, how can a function signature be used as a name?
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-discussio...@isocpp.org.
To post to this group, send email to std-dis...@isocpp.org.
Visit this group at https://groups.google.com/a/isocpp.org/group/std-discussion/.
--Brian Bi
On Monday, 18 June 2018 15:23:35 PDT T. C. wrote:
> You definitely can't define an extern "C" function that way.
Sure you can:
However, because the external
name is the same as the C library function, the above is not expected to work
in any existing system, as the C library always gets linked in to C++
applications.
On Monday, 18 June 2018 16:18:45 PDT T. C. wrote:
> On Monday, June 18, 2018 at 7:09:57 PM UTC-4, Thiago Macieira wrote:
> > On Monday, 18 June 2018 15:23:35 PDT T. C. wrote:
> > > You definitely can't define an extern "C" function that way.
> >
> > Sure you can:
> Sure, same way you can hold the ball and run in basketball.
>
> > However, because the external
> > name is the same as the C library function, the above is not expected to
> > work
> > in any existing system, as the C library always gets linked in to C++
> > applications.
>
> That's the whole point. The library definitely meant to ban this.
Are you sure? The C++ standard does not guarantee you can call ::printf.
Does it say std::printf is extern "C"?
On Monday, 18 June 2018 17:11:33 PDT T. C. wrote:
> > Are you sure? The C++ standard does not guarantee you can call ::printf.
>
> It does if you include the deprecated C++ header <stdio.h>.
That's not part of the C++ standard.