Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-496

[MSVC 7.1] printf("%#.2g", 0.0) incorrect output

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: External
    • Labels:
      None

      Description

      Moved from Rogue Wave Bugzilla: http://bugzilla.cvo.roguewave.com/show_bug.cgi?id=1549

      $ cat t.cpp && cl t.cpp && ./t.exe
      #include <assert.h>
      #include <stdio.h>
      #include <string.h>

      int main ()
      {
      char s [8];

      sprintf (s, "%#.2g", 0.0);
      assert (0 == strcmp ("0.0", s));
      }
      Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for
      80x86
      Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

      t.cpp
      Microsoft (R) Incremental Linker Version 7.10.3077
      Copyright (C) Microsoft Corporation. All rights reserved.

      /out:t.exe
      t.obj
      Assertion failed: 0 == strcmp ("0.0", s), file t.cpp, line 10

      This application has requested the Runtime to terminate it in an
      unusual way.
      Please contact the application's support team for more information.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                sebor Martin Sebor
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: