Re: [cpptips] a little initialization gem (fwd)

2000-08-21 Thread Lars Gullik Bjønnes
"Asger K. Alstrup Nielsen" [EMAIL PROTECTED] writes: | Of course, it will not detect uninitialized global variables, but you | would never use such, would you? Variables at file scope are always automatically initialized. (or is this only static variables at file scope?) Lgb

Re: [cpptips] a little initialization gem (fwd)

2000-08-21 Thread John Levon
On 21 Aug 2000, Lars Gullik Bjønnes wrote: "Asger K. Alstrup Nielsen" [EMAIL PROTECTED] writes: | Of course, it will not detect uninitialized global variables, but you | would never use such, would you? Variables at file scope are always automatically initialized. (or is this only

Re: [cpptips] a little initialization gem (fwd)

2000-08-21 Thread Lars Gullik Bjønnes
John Levon [EMAIL PROTECTED] writes: | (or is this only static variables at file scope?) | | Lgb | | | Is this a c++ thing ? No. Try this: #include stdio.h static int test1; int test2; int main() { int test3; printf("test1: %d\n", test1); printf("test2:

Re: [cpptips] a little initialization gem (fwd)

2000-08-21 Thread John Levon
On 21 Aug 2000, Lars Gullik Bjønnes wrote: No. That's what I thought. I asked just to make sure I wasn't going to embarrass myself C++-wise. Anyway, my point being, this isn't portable. Not all OS's ensure that the BSS (or equivalent) is zeroed out on load. So it would be better IMHO not to

Re: [cpptips] a little initialization gem (fwd)

2000-08-21 Thread Lars Gullik Bjønnes
John Levon [EMAIL PROTECTED] writes: | On 21 Aug 2000, Lars Gullik Bjønnes wrote: | | No. | | | That's what I thought. I asked just to make sure I wasn't going to | embarrass myself C++-wise. | | Anyway, my point being, this isn't portable. Not all OS's ensure that the | BSS (or

Re: [cpptips] a little initialization gem (fwd)

2000-08-21 Thread John Levon
On 21 Aug 2000, Lars Gullik Bjønnes wrote: John Levon [EMAIL PROTECTED] writes: | On 21 Aug 2000, Lars Gullik Bjønnes wrote: | | No. | | | That's what I thought. I asked just to make sure I wasn't going to | embarrass myself C++-wise. | | Anyway, my point being, this isn't

Re: [cpptips] a little initialization gem (fwd)

2000-08-21 Thread Lars Gullik Bjønnes
"Asger K. Alstrup Nielsen" <[EMAIL PROTECTED]> writes: | Of course, it will not detect uninitialized global variables, but you | would never use such, would you? Variables at file scope are always automatically initialized. (or is this only static variables at file scope?) Lgb

Re: [cpptips] a little initialization gem (fwd)

2000-08-21 Thread John Levon
On 21 Aug 2000, Lars Gullik Bjønnes wrote: > "Asger K. Alstrup Nielsen" <[EMAIL PROTECTED]> writes: > > | Of course, it will not detect uninitialized global variables, but you > | would never use such, would you? > > Variables at file scope are always automatically initialized. > (or is this

Re: [cpptips] a little initialization gem (fwd)

2000-08-21 Thread Lars Gullik Bjønnes
John Levon <[EMAIL PROTECTED]> writes: | > (or is this only static variables at file scope?) | > | > Lgb | > | | Is this a c++ thing ? No. Try this: #include static int test1; int test2; int main() { int test3; printf("test1: %d\n", test1); printf("test2:

Re: [cpptips] a little initialization gem (fwd)

2000-08-21 Thread John Levon
On 21 Aug 2000, Lars Gullik Bjønnes wrote: > No. > That's what I thought. I asked just to make sure I wasn't going to embarrass myself C++-wise. Anyway, my point being, this isn't portable. Not all OS's ensure that the BSS (or equivalent) is zeroed out on load. So it would be better IMHO not

Re: [cpptips] a little initialization gem (fwd)

2000-08-21 Thread Lars Gullik Bjønnes
John Levon <[EMAIL PROTECTED]> writes: | On 21 Aug 2000, Lars Gullik Bjønnes wrote: | | > No. | > | | That's what I thought. I asked just to make sure I wasn't going to | embarrass myself C++-wise. | | Anyway, my point being, this isn't portable. Not all OS's ensure that the | BSS (or

Re: [cpptips] a little initialization gem (fwd)

2000-08-21 Thread John Levon
On 21 Aug 2000, Lars Gullik Bjønnes wrote: > John Levon <[EMAIL PROTECTED]> writes: > > | On 21 Aug 2000, Lars Gullik Bjønnes wrote: > | > | > No. > | > > | > | That's what I thought. I asked just to make sure I wasn't going to > | embarrass myself C++-wise. > | > | Anyway, my point being,

Re: [cpptips] a little initialization gem (fwd)

2000-08-19 Thread Asger K. Alstrup Nielsen
On Fri, 18 Aug 2000, Baruch Even wrote: Just got this from the cpptips mailing list of Allan Clarke, this might be usefull as an ass keeper for all those uninitialized pointers in our code. What do you say about adding it to the src/support ? If I remember correctly, you can ask gcc to

Re: [cpptips] a little initialization gem (fwd)

2000-08-19 Thread Asger K. Alstrup Nielsen
On Fri, 18 Aug 2000, Baruch Even wrote: > Just got this from the cpptips mailing list of Allan Clarke, this might be > usefull as an ass keeper for all those uninitialized pointers in our code. > > What do you say about adding it to the src/support ? If I remember correctly, you can ask gcc to

[cpptips] a little initialization gem (fwd)

2000-08-18 Thread Baruch Even
Just got this from the cpptips mailing list of Allan Clarke, this might be usefull as an ass keeper for all those uninitialized pointers in our code. What do you say about adding it to the src/support ? (And about me disappearing for next week, well that will happen sunday). -- Baruch Even

[cpptips] a little initialization gem (fwd)

2000-08-18 Thread Baruch Even
Just got this from the cpptips mailing list of Allan Clarke, this might be usefull as an ass keeper for all those uninitialized pointers in our code. What do you say about adding it to the src/support ? (And about me disappearing for next week, well that will happen sunday). -- Baruch Even