GithubHelp home page GithubHelp logo

Comments (3)

Colengms avatar Colengms commented on July 17, 2024 1

Hi @leidegre I can repro this issue with 1.20.5, but it appears to be fixed in the latest prerelease (1.21.0). Closing as fixed.

from vscode-cpptools.

browntarik avatar browntarik commented on July 17, 2024

Could you provide the code snippet that is causing the issue?

Does this issue persist when all other extension except for C/C++ are disabled?

from vscode-cpptools.

leidegre avatar leidegre commented on July 17, 2024

If I try to goto the definition of the _countof macro I end up here, in vcruntime.h. __crt_countof happens to be the same length as the incorrectly colored tokens, so it is somehow mistaking _countof for __crt_countof (it's five additional characters that gets colored incorrectly).

#ifdef __cplusplus
    extern "C++"
    {
        template <typename _CountofType, size_t _SizeOfArray>
        char (*__countof_helper(_UNALIGNED _CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];

        #define __crt_countof(_Array) (sizeof(*__countof_helper(_Array)) + 0)
    }
#else
    #define __crt_countof(_Array) (sizeof(_Array) / sizeof(_Array[0]))
#endif

The actual definition of _countof is in stdlib.h and looks like this

#ifndef _countof
    #define _countof __crt_countof
#endif

This happens with all other extensions disabled.

from vscode-cpptools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.