public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51146] New: The name clog for a global variable triggers a segfault inside std::pow
@ 2011-11-15 19:53 alpha_lc at hotmail dot com
  2011-11-15 20:09 ` [Bug libstdc++/51146] " pinskia at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: alpha_lc at hotmail dot com @ 2011-11-15 19:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51146

             Bug #: 51146
           Summary: The name clog for a global variable triggers a
                    segfault inside std::pow
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: alpha_lc@hotmail.com


Adding a global variable to the code with a name like clog, while using
std::pow on a std::complex<double> triggers a segfault when std::pow is
reached. A simple example ( http://codepad.org/4Ekpgj91 ):

#include <iostream>
#include <complex>
#include <cmath>

int clog=0;

int main()
{
    std::cout<<"test1"<<std::endl;
    std::complex<double> b(1,-1);
    std::cout<<"test "<<std::pow(b,2.0)<<std::endl;
    std::cout<<"test2"<<std::endl;
}

This behavior has first been noticed on MinGW with gcc 4.5.2, but as soon as I
found out where the bug came from it was checked on codepad, and from various
gcc users in irc.freenode.net . I rate this bug as major because there might be
something deeper behind it.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-09-30 10:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-15 19:53 [Bug c++/51146] New: The name clog for a global variable triggers a segfault inside std::pow alpha_lc at hotmail dot com
2011-11-15 20:09 ` [Bug libstdc++/51146] " pinskia at gcc dot gnu.org
2011-11-15 20:13 ` alpha_lc at hotmail dot com
2011-11-15 20:21 ` [Bug c++/51146] " paolo.carlini at oracle dot com
2011-11-15 20:33 ` pinskia at gcc dot gnu.org
2011-11-15 20:33 ` paolo.carlini at oracle dot com
2011-11-15 22:44 ` joseph at codesourcery dot com
2011-11-15 23:11 ` paolo.carlini at oracle dot com
2011-11-15 23:29 ` redi at gcc dot gnu.org
2011-11-16  0:13 ` paolo.carlini at oracle dot com
2021-09-30  9:14 ` pinskia at gcc dot gnu.org
2021-09-30 10:02 ` redi at gcc dot gnu.org
2021-09-30 10:04 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).