Re: how could "atof" be so slow in vc2005?
- From: "Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx>
- Date: Wed, 5 Sep 2007 21:07:58 -0500
Don't quite qet what you mean here. If it didn't know the prototype,
how would it know what the function did?
The compiler never knows what "extern" functions do, it just generates
references which the linker must resolve.
In the "C" language (not C++), it is possible to call a function without a
prototype. The parameter types are inferred from usage and the return type
is assumed to be an int (in EAX because the calling convention is assumed to
be cdecl on x86). If the function really returns a double, it uses the FPU
stack to do so. The compiler would not know that, however, but instead use
the value of EAX in the expression, generating the wrong result.
None of this applies to C++, thankfully (although if you use command line
options for calling conventions instead of specifying per-function, you can
get similar problems).
.
- Follow-Ups:
- Re: how could "atof" be so slow in vc2005?
- From: Duane Hebert
- Re: how could "atof" be so slow in vc2005?
- From: Alexander Grigoriev
- Re: how could "atof" be so slow in vc2005?
- References:
- how could "atof" be so slow in vc2005?
- From: Leo Jay
- Re: how could "atof" be so slow in vc2005?
- From: Barry Schwarz
- Re: how could "atof" be so slow in vc2005?
- From: Duane Hebert
- how could "atof" be so slow in vc2005?
- Prev by Date: Re: Creating DLL Entry Point
- Next by Date: Re: converting char to LPCTSTR?
- Previous by thread: Re: how could "atof" be so slow in vc2005?
- Next by thread: Re: how could "atof" be so slow in vc2005?
- Index(es):
Relevant Pages
|