Re: Renaming versus initialisation



Dmitry A. Kazakov wrote:

A compiler has right to optimize out the local object. I believe, it also
can optimize out initialization/finalization pair of the target in
declaration with initialization, so in the end it could be same, though it
isn't in GNAT.

I think this analysis is correct. This is compiler dependent. The only language-required difference is that renames creates a constant and initialization can create a variable.


--
Jeff Carter
"You tiny-brained wipers of other people's bottoms!"
Monty Python & the Holy Grail
18
.



Relevant Pages

  • Re: stuck with file organisation and global a global array of strings
    ... the .h file is included from various .c files and when i compile i get ... It's a declaration. ... It's also and a definition and a default initialization, ... this is actually an objective-c project and when i say ".c" above i'm ...
    (comp.lang.c)
  • Re: Initialization is done before the program starts executing ?
    ... initialization is done once only, ... why the declaration is executed but the initialization is not? ... These two concepts are scope and execution flow. ...
    (comp.lang.c)
  • Re: char * ptr = "hello" and char carray[] = "hello"
    ... Is it a fair statement that char *ptr will take ... the first declaration creates a string ... are initialized with character string literals. ... section 4.9 Initialization, ...
    (comp.lang.c)
  • Re: History of French
    ... >Good programmers put them up at the top, ... >declaration when you need it. ... After the first time, it's *not* initialization, it's assignment. ... Richard Herring ...
    (sci.lang)
  • Re: Question on switch block scope
    ... >> Is this not a declaration with initialization, ... there is no such declaration for ... >out myself (it only requires one extra typing of the variable ... Dan Pop ...
    (comp.lang.c)