From: glen herrmannsfeldt on
Colin Watters <boss(a)qomputing.com> wrote:

> "robin" <robin51(a)dodo.com.au> wrote in message
(snip)

>> Nothing is ever initialized to zero automatically.

> Rubbish.

> See for example the compiler option "-zero" on Intel Fortran.

> http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/fortran/win/compiler_f/index.htm

Well, besides that C requires it for static data, in addition
to calloc() for allocating and zeroing.

Also, some systems have faster ways to clear large blocks
of memory than looping over an array of variables. For protection
reasons, multiuser systems require memory to be cleared if it might
still have data from another user. Normally that is with zeros.

Then again, one should learn never to make absolute statements.

-- glen
From: Richard Maine on
Gib Bogle <g.bogle(a)auckland.no.spam.ac.nz> wrote:

> glen herrmannsfeldt wrote:
>
> > Then again, one should learn never to make absolute statements.
>
> Never? ;-)

Hardly ever. :-)

--
Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain
From: glen herrmannsfeldt on
Jim Xia <jimxia(a)hotmail.com> wrote:

> Yeah, I did encounter many "DEAD BEEF". Recently I start to observe
> "bad coffe". I guess it's not listed here, but I'm sure it means
> something :-)

The first bytes of Java (compiled) class files are X'CAFEBABE'

-- glen
From: Colin Watters on


"robin" <robin51(a)dodo.com.au> wrote in message
news:4bce6070$0$895$c30e37c6(a)exi-reader.telstra.net...
> "Colin Watters" <boss(a)qomputing.com> wrote in message
> news:hqkvmd$t8d$1(a)news.eternal-september.org...
> |
> | "robin" <robin51(a)dodo.com.au> wrote in message
> | news:4bcdd1a5$0$893$c30e37c6(a)exi-reader.telstra.net...
> | > "Gib Bogle" <g.bogle(a)auckland.no.spam.ac.nz> wrote in message
> | > news:hqjgq0$iad$1(a)speranza.aioe.org...
> | > | Should one rely on allocated arrays being initialized to zero?
> | >
> | > Nothing is ever initialized to zero automatically.
>
> | Rubbish.
> |
> | See for example the compiler option "-zero" on Intel Fortran.
>
> Is that standard Fortran?
>
>

Where does it say "standard Fortran" in "Nothing is ever initialized to
zero automatically"?

--
Qolin

Email: my qname at domain dot com
Domain: qomputing


From: Uno on
Richard Maine wrote:
> Uno <merrilljensen(a)q.com> wrote:
>
>> What does one need to do to set all of an object's attributes to zero?
>
> That doesn't even make sense. Most attributes aren't numeric at all and
> aren't "settable" during execution. I can only suppose you mean
> something other than "attribute", but I can't guess what it would be.
>

I think I wanted the word "component."

How would I set the real components of the living object to zero at the
gitgo?

implicit none

real :: footage, sqft, calc, supply
integer :: cases

type room
real :: hor
real :: vert
character(len=10) :: name
real :: subtract
end type room

type(room) :: living

sqft = 144

cases = 28
footage = 24
supply = cases * footage
print *, "wood supply is ", supply

living%hor = 42
living%vert = 100
living%subtract = 15

calc = living%hor * living%vert - living%subtract

print *, "calc is ", calc

end program
! gfortran -Wall -Wextra m2.f90 -o out
--
Uno