Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Including `stdatomic.h` causes `size_t` to report the wrong type in Intellisense

未关闭
#14,825 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
c
领域
devtools

调研方向

Start by reproducing with a minimal C file that includes stdatomic.h and declares size_t capacity = 0, then hover over size_t. The issue reports it resolving to typedef int size_t(bool) instead of unsigned long long, which the header-free case shows correctly. The configuration uses /experimental:c11atomics and /std:c17 with windowsSdkVersion 10.0.28000.0, so reproduce under those settings. Done means size_t resolves to the correct type with the header included, and the reporter's configuration is verified.

由索引模型根据 Issue 内容生成。

描述

Environment
  • OS and Version: Windows 11 Pro, 26H2
  • VS Code Version: 1.141.0
  • C/C++ Extension Version: 1.34.4
  • If using SSH remote, specify OS of remote machine: N/A
Bug Summary and Steps to Reproduce

Bug Summary:

Including stdatomic.h causes havoc with the size_t type, causing Intellisense failures.

Steps to reproduce:

Create a c source file that includes stdatomic.h

Make a variable of size_t (e.g size_t capacity = 0) in the code.
Hover over size_t
It will report that size_t is defined as typedef int size_t(bool)
This is incorrect.

If you remove or comment out the stdatomic.h header and hover over size_t
It will report that size_t is defined as unsigned long long size_t
This is correct.

Apparently, this is an issue in Visual Studio as well.

Configuration and Logs
{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "${env:INCLUDE}"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.28000.0",
            "compilerPath": "cl.exe",
            "cStandard": "c11",
            "cppStandard": "c++23",
            "intelliSenseMode": "windows-msvc-x64",
            "compilerArgs": [
                "/std:c17",
                "/experimental:c11atomics"
            ]
        }
    ],
    "version": 4
}
Other Extensions

N/A

Additional context

Intellisense is completely confused about how to parse the stdatomic.h header, or more precisely, the platform specific of the header that stdatomic.h includes.

主要语言
TypeScript
星标
6.2k
派生
1.7k
平均合并
1 天 18 小时
30 天内合并 PR
38

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/vscode-cpptools 的其他 Issue

查看 microsoft/vscode-cpptools 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。