Thread overview
warnings in STLport's vector
Sep 21, 2001
Laurentiu Pancescu
Sep 21, 2001
Jan Knepper
Oct 02, 2001
Walter
September 21, 2001
I'm getting warning 12 (variable _TMP0 used before init) in
stl/_bvector.h, line 826 (there's just a typedef!!), with
optimizations turned on.  No warning is issued with optimizations set
to "none".

I'm using DMC 8.1d.  Is this a compiler bug, or a STLport installation problem?


Laurentiu

September 21, 2001
As far as I know it has to do with compiler optimization.
I recall having the same problems with SGI STL at times.
For now I just turned off optimization as I could not isolate which
optimization flag really causes this warning.



Laurentiu Pancescu wrote:

> I'm getting warning 12 (variable _TMP0 used before init) in
> stl/_bvector.h, line 826 (there's just a typedef!!), with
> optimizations turned on.  No warning is issued with optimizations set
> to "none".
>
> I'm using DMC 8.1d.  Is this a compiler bug, or a STLport installation problem?
>
> Laurentiu

October 02, 2001
Laurentiu Pancescu wrote in message <9ofkeo$r27$1@digitaldaemon.com>...
>I'm getting warning 12 (variable _TMP0 used before init) in
>stl/_bvector.h, line 826 (there's just a typedef!!), with
>optimizations turned on.  No warning is issued with optimizations set
>to "none".
>
>I'm using DMC 8.1d.  Is this a compiler bug, or a STLport installation problem?


What I noticed in compiling SGI STL is that the STL uses empty struct's to transmit type information, rather than a value. These struct's have no members, and so are not initialized. I adjusted the compiler warning so that structs with no members don't produce the warning.

The warning itself is benign, which is likely why you did not notice any actual runtime problems from it.

-Walter