[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] About global parameter initial problem

From: Alain M.
Subject: Re: [lwip-users] About global parameter initial problem
Date: Wed, 26 Nov 2008 11:22:06 -0200
User-agent: Thunderbird (X11/20080914)

There is a possibility that it is not the compiler, but your startup code.

When a C program runs in an embedded (or anywhere), there is code that runs before main(). That code is responsible for initing your global variables.

Search you startup code, some times called crt.S ...

I have seen problems with this many times :)

Simon Goldschmidt escreveu:
I find the lwIP did not manually init global parameters. In most of the

And it does this on purpose.

system, the global paramter has default zero.  But my embeded system only
init the static paramters, and won't init the gloable parameters.

That's a bug in your compiler. We've had this discussion some months ago. Since 
we do not want to support broken compilers, we decided the ones with broken 
compilers should add initialization on their own, I think... Sorry.

Initializing globals to zero is defined in the C standard somewhere. If you're 
interested in where (e.g. want to tell your compiler vendor to fix it), you can 
search the mailing list archive for the discussion, it was mentioned here a 
while ago.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]