string class problem

P

P.J. Plauger

James Kanze wrote in message...
/* """
(<cstdlib> is another story; none of the
compilers I have access to include the required overloads of
atexit, for example.)
""" */
I'm a little in-the-fog here [1].
// -------
In <cstdlib> (GCC(MinGW)3.3.1), after the #undefs:

namespace std {
// .....
using ::atexit;
// ..... }

Which, of course, isn't a legal implementation according to the
current standard (although the next release will make it one).
In <stdlib.h>:
/* Note: This is in startup code, not imported directly from dll */
int __cdecl atexit (void (*)(void));
// -------
What 'required overloads' are you refering to?

extern "C" int atexit(void (*f )(void))
extern "C++" int atexit(void (*f )(void))

Note that the standard requires this for every function in the C
library which takes a callback.

And of course, the real problem here is that the compiler isn't
conform; a header which did the above with g++ probably wouldn't
compile. (But then, g++ is just behaving like most other
implementors in this respect: implement whatever you feel like,
rather than what the standard requires.)

[pjp] There you go again. Most of us implementors try to implement
what we think our customers want/need, as best we understand it.
Those of us who have merely implemented whatever we feel like have
fallen by the wayside.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
 
J

James Kanze

"James Kanze" <[email protected]> wrote in message
[pjp] There you go again. Most of us implementors try to implement
what we think our customers want/need, as best we understand it.
Those of us who have merely implemented whatever we feel like have
fallen by the wayside.

I think that's true for some of the smaller implementors, like
you or EDG. It's definitly not true of Microsoft or of G++;
both have their own programs, and expect (or force) the users to
go along. Most of the times, their programs aren't that bad,
because they do take into account the users' needs. But both
Microsoft and g++ seem to make a major point of ignoring export,
which I (and I suppose most other people working on large
projects) desparately need.
 
B

BobR

What 'required overloads' are you refering to?

extern "C" int atexit(void (*f )(void))
extern "C++" int atexit(void (*f )(void))

Note that the standard requires this for every function in the C
library which takes a callback.
""" */

Thanks, James.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top