lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [task #7054] Clarification needed for variable initializati


From: Frédéric Bernon
Subject: [lwip-devel] [task #7054] Clarification needed for variable initialization
Date: Wed, 04 Jul 2007 07:58:21 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

Follow-up Comment #3, task #7054 (project lwip):

In "The C Programming Language" by Kernighan & Ritchie, we can read "External
and static variables are initialized to zero by default." Of course, you need
to have a ANSI C compiler to be sure of that.

Problem with that is you have to be sure your compiler is really ANSI. So,
using _init functions the only solution to be sure about the init value for
any compiler.

Using INIT_NULL is a good idea since each one can decide to belive or not the
ANSI compilance of his compiler. For array like tcp_backoff, I  think you can
let them like this. For ZEROing arrays, you could do the same thing that
INIT_NULL like:

#define INIT_ARRAY_NULL = {0}



    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?7054>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

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