You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2007/09/26 01:01:50 UTC

[jira] Closed: (STDCXX-315) std::valarray transcendentals use uninitialized storage

     [ https://issues.apache.org/jira/browse/STDCXX-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor closed STDCXX-315.
-------------------------------

    Resolution: Fixed

Fix (http://svn.apache.org/viewvc?rev=579408&view=rev) verified in a manual test.
Regression test committed here:http://svn.apache.org/viewvc?rev=579403&view=rev
Closing.

> std::valarray transcendentals use uninitialized storage
> -------------------------------------------------------
>
>                 Key: STDCXX-315
>                 URL: https://issues.apache.org/jira/browse/STDCXX-315
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 26. Numerics
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4
>         Environment: all
>            Reporter: Martin Sebor
>            Assignee: Martin Sebor
>            Priority: Minor
>             Fix For: 4.2
>
>
> The program below is expected to produce no output. When compiled with the latest trunk it produces output indicating that the valarray transcendental functions use uninitialized storage.
> $ cat t.cpp && make t && ./t
> #include <cstdio>
> #include <valarray>
> bool pass = true;
> struct S {
>     const S* const self;
>     S (): self (this) { }
>     S (const S &s): self (this) { pass = pass && &s == s.self; }
>     S (double): self (this) { }
>     ~S () { pass = pass && this == self; }
>     operator double () const { pass = pass && this == self; return 1.0; }
>     void operator=(const S &s) const {
>         pass = pass && &s == s.self && this == self;
>     }
>     S operator- () const { pass = pass && this == self; return *this; }
>     bool operator< (const S &s) const {
>         pass = pass && &s == s.self && this == self;
>         return false;
>     }
> };
> int main ()
> {
>     const S s;
>     const std::valarray<S> a (2);
> #define TEST(fun, args) \
>     pass = true; \
>     fun args; \
>     if (!pass) \
>         std::fprintf (stderr, "std::%s uses uninitialized storage\n", #fun)
>     TEST (abs, (a));
>     TEST (acos, (a));
>     TEST (asin, (a));
>     TEST (atan, (a));
>     TEST (atan2, (a, a));
>     TEST (atan2, (a, s));
>     TEST (atan2, (s, a));
>     TEST (cos, (a));
>     TEST (cosh, (a));
>     TEST (exp, (a));
>     TEST (log, (a));
>     TEST (log10, (a));
>     TEST (pow, (a, a));
>     TEST (pow, (a, s));
>     TEST (pow, (s, a));
>     TEST (sin, (a));
>     TEST (sinh, (a));
>     TEST (sqrt, (a));
>     TEST (tan, (a));
>     TEST (tanh, (a));
> }
> gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG    -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/examples/include  -pedantic -nostdinc++ -g  -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long   t.cpp
> gcc t.o -o t  -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s  -lsupc++ -lm 
> std::abs uses uninitialized storage
> std::acos uses uninitialized storage
> std::asin uses uninitialized storage
> std::atan uses uninitialized storage
> std::atan2 uses uninitialized storage
> std::atan2 uses uninitialized storage
> std::atan2 uses uninitialized storage
> std::cos uses uninitialized storage
> std::cosh uses uninitialized storage
> std::exp uses uninitialized storage
> std::log uses uninitialized storage
> std::log10 uses uninitialized storage
> std::pow uses uninitialized storage
> std::pow uses uninitialized storage
> std::pow uses uninitialized storage
> std::sin uses uninitialized storage
> std::sinh uses uninitialized storage
> std::sqrt uses uninitialized storage
> std::tan uses uninitialized storage
> std::tanh uses uninitialized storage

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.