[U-Boot] [PATCH 12/26 v2][NEXT] ARM: add relocation support

Wolfgang Denk
2010-09-17T19:22:22Z

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