lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] [patch #7737] Initialize all global variables to 0 or N


From: Mason
Subject: Re: [lwip-devel] [patch #7737] Initialize all global variables to 0 or NULL.
Date: Wed, 07 Mar 2012 11:05:59 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Firefox/10.0.2 SeaMonkey/2.7.2

Bostjan Meglic wrote:

> URL: http://savannah.nongnu.org/patch/?7737
> 
>        Summary: Initialize all global variables to 0 or NULL.
>        Project: lwIP - A Lightweight TCP/IP stack
>   Submitted by: bostjanm
>   Submitted on: Wed 07 Mar 2012 09:38:48 AM GMT

The proposed patch is unnecessary.

3.1.2.4 Storage durations of objects

   An object declared with external or internal linkage, or with the
storage-class specifier static has static storage duration.  For such
an object, storage is reserved and its stored value is initialized
only once, prior to program startup.  The object exists and retains
its last-stored value throughout the execution of the entire
program.

3.5.7 Initialization

   If an object that has static storage duration is not initialized
explicitly, it is initialized implicitly as if every member that has
arithmetic type were assigned 0 and every member that has pointer type
were assigned a null pointer constant.


Moreover, sys_mbox_t may be typedef to a struct.

-- 
Regards.



reply via email to

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