This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Huge stack growth on using pow function

On using pow function defined in math.h, stack grows at 1904 bytes. Am i making some mistake in corrext execution or stack grows at such huge size on using pow function. Below is my code also

I am using LPC1317 with MDK V4.72.

#include "LPC13Uxx.h" /* LPC13xx definitions */
#include "math.h"

float32_t x,y,z;

int main(void)
{
    x = 2.3;
    y = 1.5;

    z = pow(x,y);
    if(z)
    {

    }

    while(1);
}

Parents
  • But there is nothing implying it is a bug that the amount of memory differs - the size of information linked into the application will depend on how the library is structured. Maybe the newer library has been slightly rewritten, allowing the linker to be more selective in what to drag in.

    Take 10 PC compilers and use to build a "Hello World!" application. Compare the huge difference in size of that trivial application. What you see isn't bugs in the compilers but differences in the design of startup files and C runtime libraries.

Reply
  • But there is nothing implying it is a bug that the amount of memory differs - the size of information linked into the application will depend on how the library is structured. Maybe the newer library has been slightly rewritten, allowing the linker to be more selective in what to drag in.

    Take 10 PC compilers and use to build a "Hello World!" application. Compare the huge difference in size of that trivial application. What you see isn't bugs in the compilers but differences in the design of startup files and C runtime libraries.

Children
No data