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

"Find References to Symbol Under Cursor" not always working with GCC 4.4

    XMLWordPrintable

Details

    • Linux/X11

    Description

      When configuring a kit based on auto-detected Desktop but using GCC-4.4 as C and C++ compilers, while the clang code model plugin is enabled, "Find References to Symbol Under Cursor" does not find definitions and all usages in all cases in the attached project. See comments in attached project to reproduce.

      Note that GCC 4.4 defines the internal macro __cplusplus to the non-standard value 1 which triggers a soft assertion in toLanguageVersionAsLong in ProjectExplorer's ToolChain.cpp. This was a bug in GCC that lasted for 10 years: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=1773.

      The bug happens since commit

      04caf7594eb998b039c2a7a1712946092289bfb2 and can be reproduced on 64-bit ArchLinux by installing the "gcc44" package from AUR: https://aur.archlinux.org/packages/gcc44/. When creating the kit (copying from "Desktop"), select the 64-bit versions of the GCC 4.4 compilers.

      I'm happy to provider further information if needed.

       

      P.S.

      The defines provided by the C++ code model are:

      #define _DBL_MIN_EXP_ (-1021)

      #define _FLT_MIN_ 1.17549435e-38F

      #define _CHAR_BIT_ 8

      #define _WCHAR_MAX_ 2147483647

      #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1

      #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1

      #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1

      #define _DBL_DENORM_MIN_ 4.9406564584124654e-324

      #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1

      #define _FLT_EVAL_METHOD_ 0

      #define _unix_ 1

      #define __x86_64 1

      #define _DBL_MIN_10_EXP_ (-307)

      #define _FINITE_MATH_ONLY_ 0

      #define _LP64_ 1

      #define _GNUC_PATCHLEVEL_ 7

      #define _DEC64_MAX_EXP_ 385

      #define _SHRT_MAX_ 32767

      #define _LDBL_MAX_ 1.18973149535723176502e+4932L

      #define _UINTMAX_TYPE_ long unsigned int

      #define __linux 1

      #define _DEC32_EPSILON_ 1E-6DF

      #define __unix 1

      #define _LDBL_MAX_EXP_ 16384

      #define _linux_ 1

      #define _SCHAR_MAX_ 127

      #define _DBL_DIG_ 15

      #define _SIZEOF_INT_ 4

      #define _SIZEOF_POINTER_ 8

      #define _USER_LABEL_PREFIX_

      #define _STDC_HOSTED_ 1

      #define _LDBL_HAS_INFINITY_ 1

      #define _FLT_EPSILON_ 1.19209290e-7F

      #define _GXX_WEAK_ 1

      #define _LDBL_MIN_ 3.36210314311209350626e-4932L

      #define _DEC32_MAX_ 9.999999E96DF

      #define _SIZEOF_LONG_ 8

      #define _DECIMAL_DIG_ 21

      #define _gnu_linux_ 1

      #define _LDBL_HAS_QUIET_NAN_ 1

      #define _GNUC_ 4

      #define __GXX_RTTI 1

      #define _MMX_ 1

      #define _FLT_HAS_DENORM_ 1

      #define _SIZEOF_LONG_DOUBLE_ 16

      #define _BIGGEST_ALIGNMENT_ 16

      #define _DBL_MAX_ 1.7976931348623157e+308

      #define _DBL_HAS_INFINITY_ 1

      #define _DEC32_MIN_EXP_ (-94)

      #define _LDBL_HAS_DENORM_ 1

      #define __cplusplus 1

      #define _DEC128_MAX_ 9.999999999999999999999999999999999E6144DL

      #define _DEC32_MIN_ 1E-95DF

      #define __DEPRECATED 1

      #define _DBL_MAX_EXP_ 1024

      #define _DEC128_EPSILON_ 1E-33DL

      #define _SSE2_MATH_ 1

      #define __amd64 1

      #define _GNUG_ 4

      #define _LONG_LONG_MAX_ 9223372036854775807LL

      #define _SIZEOF_SIZE_T_ 8

      #define _SIZEOF_WINT_T_ 4

      #define __GCC_HAVE_DWARF2_CFI_ASM 1

      #define __GXX_ABI_VERSION 1002

      #define _FLT_MIN_EXP_ (-125)

      #define _DBL_MIN_ 2.2250738585072014e-308

      #define _FLT_MIN_10_EXP_ (-37)

      #define _DECIMAL_BID_FORMAT_ 1

      #define _DEC128_MIN_ 1E-6143DL

      #define _REGISTER_PREFIX_

      #define _DBL_HAS_DENORM_ 1

      #define _NO_INLINE_ 1

      #define _FLT_MANT_DIG_ 24

      #define _VERSION_ "4.4.7"

      #define _DEC64_EPSILON_ 1E-15DD

      #define _DEC128_MIN_EXP_ (-6142)

      #define unix 1

      #define _SIZE_TYPE_ long unsigned int

      #define _ELF_ 1

      #define _FLT_RADIX_ 2

      #define _LDBL_EPSILON_ 1.08420217248550443401e-19L

      #define __k8 1

      #define _SIZEOF_PTRDIFF_T_ 8

      #define _x86_64_ 1

      #define _DEC32_SUBNORMAL_MIN_ 0.000001E-95DF

      #define _FLT_HAS_QUIET_NAN_ 1

      #define _FLT_MAX_10_EXP_ 38

      #define _LONG_MAX_ 9223372036854775807L

      #define _DEC128_SUBNORMAL_MIN_ 0.000000000000000000000000000000001E-6143DL

      #define _FLT_HAS_INFINITY_ 1

      #define _DEC64_MAX_ 9.999999999999999E384DD

      #define _CHAR16_TYPE_ short unsigned int

      #define _DEC64_MANT_DIG_ 16

      #define _DEC32_MAX_EXP_ 97

      #define linux 1

      #define _SSE2_ 1

      #define __EXCEPTIONS 1

      #define _LDBL_MANT_DIG_ 64

      #define _DBL_HAS_QUIET_NAN_ 1

      #define _k8_ 1

      #define _WCHAR_TYPE_ int

      #define _SIZEOF_FLOAT_ 4

      #define _pic_ 2

      #define _DEC64_MIN_EXP_ (-382)

      #define _FLT_DIG_ 6

      #define _INT_MAX_ 2147483647

      #define _amd64_ 1

      #define _FLT_MAX_EXP_ 128

      #define _DBL_MANT_DIG_ 53

      #define _DEC64_MIN_ 1E-383DD

      #define _WINT_TYPE_ unsigned int

      #define _SIZEOF_SHORT_ 2

      #define _SSE_ 1

      #define _LDBL_MIN_EXP_ (-16381)

      #define _LDBL_MAX_10_EXP_ 4932

      #define _DBL_EPSILON_ 2.2204460492503131e-16

      #define _LP64 1

      #define _SIZEOF_WCHAR_T_ 4

      #define _DEC_EVAL_METHOD_ 2

      #define _INTMAX_MAX_ 9223372036854775807L

      #define _FLT_DENORM_MIN_ 1.40129846e-45F

      #define _PIC_ 2

      #define _CHAR32_TYPE_ unsigned int

      #define _FLT_MAX_ 3.40282347e+38F

      #define _SIZEOF_DOUBLE_ 8

      #define _INTMAX_TYPE_ long int

      #define _DEC128_MAX_EXP_ 6145

      #define _GNUC_MINOR_ 4

      #define _DEC32_MANT_DIG_ 7

      #define _DBL_MAX_10_EXP_ 308

      #define _LDBL_DENORM_MIN_ 3.64519953188247460253e-4951L

      #define _STDC_ 1

      #define _PTRDIFF_TYPE_ long int

      #define _DEC64_SUBNORMAL_MIN_ 0.000000000000001E-383DD

      #define _DEC128_MANT_DIG_ 34

      #define _LDBL_MIN_10_EXP_ (-4931)

      #define _SSE_MATH_ 1

      #define _SIZEOF_LONG_LONG_ 8

      #define _LDBL_DIG_ 18

      #define _GNUC_GNU_INLINE_ 1

      #define _GNU_SOURCE 1

       

      Attachments

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

        Activity

          People

            madwinter Marcus Tillmanns
            shentey2 Bernhard Beschow
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes