Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-21038

Debugging uint16_t shows incorrect value (-1) when used from a method that comes through an "extern C"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 4.8.0-beta1
    • Qt Creator 4.7.0, Qt Creator 4.7.1
    • Debugger
    • None
    • linux, GNU gdb (GDB) 8.1.1, clang version 6.0.1, gcc (GCC) 8.2.1
    • Linux/X11
    • 089b50f7d3570266a88c3902e58d4f371b12224d (qt-creator/qt-creator/4.8)

    Description

      If I step into the u8s_to_16 function (inside the attached example) which is included through `extern C` the values suddenly switch to -1 when the shift `<< 8` happens, if using the same code in a .cpp file (see main.cpp) then everything is shown correctly.
      If I use the gdb from the console and step through the program, the values are displayed correctly.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hjk hjk
            cmon Simon Schäfer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes