[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hpux-cxx-dev
Subject:    Re:  CXX-DEV: [Fwd: aCC and STL questions]
From:       Dennis Handly <dhandly () hpcllmx ! cup ! hp ! com>
Date:       2000-05-26 23:40:16
[Download RAW message or body]

>From: "Patrick Fortner" <patrick_fortner@mentorg.com>
>However, I still get the message about:
>Warning 5004: Exact position unknown; near. #
>    Uninitialized variable "static_value" in function "main" (5004)

>This only gets printed then the optimizer is turned on.  This seems like it
>must be a bug in the compiler.
Patrick

It depends.  The bug could be in your code.  Only the optimizer's flow
control detects it.

>From: Tuomo Tikkanen <tuomo.tikkanen@nokia.com>
>i.e. there was only one parameter (the size of the vector) given to the

Yes.

>Hopefully it is corrected in A.03.25.

Yes, this is CR JAGab16727
Must use constructor and resize with default arg

You can workaround it by changing lines in <vector> to:

T value = T();

>If I remember it right we got this same warning also from static
>vector<POD> type variables inside functions too.
<< Tuomo-Markus Tikkanen <> Tuomo.Tikkanen@nokia.com >>

Yes.

>From: Paul S R Chisholm <psrc@lucent.com>
>>Unfortunately the values were left uninitialized when compiled with aCC.

>IMHO, this behavior is correct. The default constructor for built-in 
>integral types does *not* initialize the value to zero; it leaves it 
>undefined.
 --PSRC

No, it is not correct.  The Standard says that parms to vector are:
   explicit vector(size_type n, const T& value = T(),
                   const Allocator& alloc = Allocator());

And this provides the default value of zeroes for PODs.

>From: Matthew Collins <collins@hpsgns1.sgp.hp.com>
>The compiler fails to give any warning for the usage of dud2 in y().

Only the trivial cases are caught by the frontend.

>However the compiler prefixes the variable name with static_
Matthew Collins

This is CR JAGaa86483
Warning 5004 gives uninit var msg with "static_" preappended
 _________________________________________________________________
 To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
    with the message UNSUBSCRIBE cxx-dev
 _________________________________________________________________

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic