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

Inconsistency between macro types

XMLWordPrintable

    • a450c13327124483ff36546a4c1f8488aa945c39

      #include <string.h>
      
      #define RESET(d,l) memset((d), (f), (0))
      #define STRCMP strcmp
      
      int main()
      {
          char *buffer = "foo";
          STRCMP(buffer, "foo"); // Find Usages finds strcmp (in string.h)
          RESET(buffer, 4); // Find Usages finds #define RESET(d,l)...
          return 0;
      }

      Macros that accept parameters are found using "Find Usages", while macros that accept no parameters are not.
      "Follow Symbol" for both leads to the referenced symbol rather than the macro (QTCREATORBUG-6175).

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

            erikv Erik Verbruggen
            orgads Orgad Shaneh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes