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

            Bug ID: 58327
           Summary: Problem of quadmath in connection with SDL2
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libquadmath
          Assignee: unassigned at gcc dot gnu.org
          Reporter: u.weber at gipko dot de

"quadmath_snprintf" gives strange results, when SDL2
(http://www.libsdl.org/download-2.0.php) is additionally included. I'm using
"MinGW" with "DevC++" or "Code::Blocks". The short program:

  extern "C" {
  #include "quadmath.h"
  }

  #include "SDL2\SDL.h"
  #include <iostream>

  int main(int argc, char* argv[])
  {  char buf[128];
     quadmath_snprintf (buf, sizeof buf, "%+-#*.20Qe", 46, M_PIq);
     std::cout <<  "PI = " << (float)M_PIq << " / " << buf << std::endl;   
  }

gives the result:

PI = 3.14159 / +3.78539161562520278725e-4917

but when I delete or comment the line  // #include "SDL2\SDL.h" 
I get the expected result:

PI = 3.14159 / +3.14159265358979323846e+00

I guess this is related to Bug 51007 but I don't know how to fix this problem.
I would like to use "quadmath" and "SDL2" together.

Reply via email to