[Top][All Lists]

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

Re: [lwip-users] Initialization of global variables

From: Simon Goldschmidt
Subject: Re: [lwip-users] Initialization of global variables
Date: Sat, 6 Nov 2010 12:05:56 +0100

 Piotr Piwko <address@hidden> wrote:

> All right, so maybe it should be done in the relevant initialization
> routines, tcp_init(), udp_init() and so on?

That increases code size unnecessarily, too. The only way to not increase code- 
or ROM-size would be to add an initialization function in every module and let 
the linker leave that away when not used. However, this cannot be checked 
easily, as in normal environments (e.g. when testing), you wouldn't notice 
missing variables in those functions as they are initialized to zero, anyway.

> On the other hand this issue just can be described somewhere in source
> code or better in wiki documentation, because it really may take a lot
> of time.

As many people don't seem to know that ANSI C requires uninitialized globals to 
be zeroed, it might really be necessary to add that to the description of 
creating an lwIP port.


reply via email to

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