On Dec 14, 2007 9:31 AM, brian m. carlson
<[EMAIL PROTECTED]> wrote:
> >> backward/auto_ptr.h:177: warning:
> >> 'hash.std::auto_ptr<Botan::HashFunction>::_M_ptr' is used
> >> uninitialized in this function
> >> botan/dsa_gen.cpp:57: note:
> >> 'hash.std::auto_ptr<Botan::HashFunction>::_M_ptr' was declared here
> >>
> >> Looks spurious; the variable in question is declared with a
> >> constructor expression.  (I am ignorant of what is going on inside
> >> auto_ptr though.)
>
> Assuming it is actually initialized using a constructor, then yes, this
> appears to be spurious.  I haven't actually looked at the botan code,
> though.

It's definitely spurious.  This is a minimal test case:

  #include <string>
  #include <memory>
  class HashFunction {};
  HashFunction *get_hash (std::string const &);
  void generate_dsa_primes (void)
  { std::auto_ptr <HashFunction> hash(get_hash("SHA-160")); }

(If you change get_hash's argument to const char *, the diagnostic
goes away.  Bizarre.)

Is now GCC bug #34470.

zw



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to