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

multiple identical hits for macro usage

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Not Evaluated
    • None
    • Qt Creator 8.0.0
    • C/C++/Obj-C++ Support
    • None

    Description

      suppose this code:

      static void function_real(int a, int b) {}
      #define macro1(r) ((r) & 255)
      #define macro2(r) ((r) >> 8)
      #define function(a) function_real(macro1(a), macro2(a))
      
      #define CONSTANT 0x203
      
      int main()
      {
        function(CONSTANT);
        return 0;
      }
      

      then searching for usages of CONSTANT will yield two identical hits on the line where function() is invoked. this is kinda correct in the sense that CONSTANT is, indeed, used twice on that line, but it's certainly not what the user expects.

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            buddenha Oswald Buddenhagen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes