From: Wolfgang Denk Date: Fri, 17 Sep 2010 21:22:22 +0200 Subject: [U-Boot] [PATCH 12/26 v2][NEXT] ARM: add relocation support In-Reply-To: <4C939ADD.5090009@free.fr> References: <4C62E8C3.8050006@denx.de> <1284721853-8298-1-git-send-email-hs@denx.de> <1284721853-8298-2-git-send-email-hs@denx.de> <1284721853-8298-3-git-send-email-hs@denx.de> <1284721853-8298-4-git-send-email-hs@denx.de> <1284721853-8298-5-git-send-email-hs@denx.de> <1284721853-8298-6-git-send-email-hs@denx.de> <1284721853-8298-7-git-send-email-hs@denx.de> <1284721853-8298-8-git-send-email-hs@denx.de> <1284721853-8298-9-git-send-email-hs@denx.de> <1284721853-8298-10-git-send-email-hs@denx.de> <1284721853-8298-11-git-send-email-hs@denx.de> <1284721853-8298-12-git-send-email-hs@denx.de> <1284721853-8298-13-git-send-email-hs@denx.de> <4C936823.1060802@free.fr> <20100917145430.4047615242D@gemini.denx.de> <4C939ADD.5090009@free.fr> Message-ID: <20100917192222.069D615242D@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Albert ARIBAUD, In message <4C939ADD.5090009@free.fr> you wrote: > > >>> init_fnc_t *init_sequence[] = { > >> > >> init_sequence is a constant, not an initialized variable, and thus > >> should have the 'const' qualifier. > > > > Actually it _is_ an initialized variable (which still may take a > > const). > > Maybe we're having a terminology discrepancy here. We are talking about C code here, so I apply the terminology of the C programming language. > For me an initialized variable is a *variable*, i.e. intended to *vary* > over execution time, and which is initialized, i.e. set to a known > initial value; whereas a const has a value which does not vary over > execution time, and thus a const is not a variable. A variable is a meaningful name of a data storage location in computer memory. The term "variable" does not include specific properties of this storage location. In the C programming language, additional qualifiers are used to refer to specific properties, like "automatic variable", "initialized variable", "global variable", etc. The C code line above declares a _variable_ with the name "init_sequence" as an array of pointers to objects of type init_fnc_t. C does not have a notation to declare "constants". Even if you add a "const" type qualifier (or two), it's still a declaration of a variable. > In that sense, and as init_sequence does not, and should not, vary over > execution time, it is not a variable. Indeed, you use a different terminology. Let's end this discussion here. Please. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "It is better to have tried and failed than to have failed to try, but the result's the same." - Mike Dennison