Brief summary
Microsoft C/C++ Extension's IntelliSense (EDG parser) flags sp in a
GCC inline asm clobber list as an error (severity 8) on ARM
(ARMv7-M / Cortex-M3). The underlying concern is real —
arm-none-eabi-gcc 15.2.1 also flags the same pattern, but as a
warning (-Wdeprecated), not an error.
The problem is the severity mismatch: vscode-cpptools elevates what
GCC treats as a deprecation warning to an error-level diagnostic in the
Problems panel, making it indistinguishable from a hard compile-blocking
error.
In any CMSIS-based Cortex-M3 project, every reference to __set_PSP /
__set_MSP — the standard CMSIS helpers in core_cmFunc.h distributed
by ARM and used by every silicon vendor (STM32, NXP, Nordic, ...) — is
flagged at error severity.
Steps to reproduce
repro.c (no vendor dependency):
#include <stdint.h>
static inline void set_psp(uint32_t topOfProcStack)
{
__asm volatile ("MSR psp, %0\n" : : "r" (topOfProcStack) : "sp");
}
static inline void set_msp(uint32_t topOfMainStack)
{
__asm volatile ("MSR msp, %0\n" : : "r" (topOfMainStack) : "sp");
}
int main(void)
{
set_psp(0x20018000U);
set_msp(0x20018000U);
return 0;
}
Minimal .vscode/c_cpp_properties.json:
{
"version": 4,
"configurations": [{
"name": "Cortex-M3",
"intelliSenseMode": "linux-gcc-arm",
"compilerPath": "<path-to>/arm-none-eabi-gcc",
"cStandard": "c11"
}]
}
Open repro.c in VS Code → IntelliSense underlines "sp" in both
clobber lists and reports the diagnostic at error severity in the
Problems panel.
Expected behavior
A warning-level diagnostic is acceptable — GCC itself emits
-Wdeprecated for this pattern. The expected behavior is that
IntelliSense reports this at warning severity (matching GCC), not at
error severity that visually masks real compile errors.
Actual behavior
IntelliSense reports the sp token in the clobber list at
severity 8 (error). The error squiggle appears in the editor and the
Problems panel for every translation unit that pulls in CMSIS
core_cmFunc.h (i.e. essentially every Cortex-M project that calls
__set_PSP / __set_MSP).
For comparison, arm-none-eabi-gcc 15.2.1 emits the same diagnostic at
warning severity:
$ arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -O2 -Wall -Wextra -c repro.c -o repro.o
warning: listing the stack pointer register 'sp' in a clobber list is deprecated [-Wdeprecated]
note: the value of the stack pointer after an 'asm' statement must be the same as it was before the statement
(emitted twice — once each for set_psp and set_msp)
The compile completes successfully (the diagnostic is -Wdeprecated,
not -Werror=deprecated).
Configuration and Logs
| Item |
Value |
| VS Code |
1.121.0 (x64, commit f6cfa2ea2403534de03f069bdf160d06451ed282) |
| C/C++ Extension |
ms-vscode.cpptools 1.32.2 (win32-x64) |
| OS |
Windows 11, build 10.0.26200.8457 |
| Compiler |
Arm GNU Toolchain 15.2.Rel1 — arm-none-eabi-gcc 15.2.1 (2025-12-03 release) |
intelliSenseMode |
linux-gcc-arm |
cStandard |
c11 |
| Target |
ARMv7-M (Cortex-M3) |
VS Code C/C++: Log Diagnostics and C/C++: Show Language Server Log
outputs were not captured in this initial report. They can be regenerated
and attached on maintainer request — the diagnostic is fully reproducible
on demand from the minimal example above and does not depend on any
workspace-specific state beyond the four-line c_cpp_properties.json
shown above.
Related closed issues
May be related to the same EDG behavior previously addressed for other
targets — though this issue is specifically about severity (error
vs. warning), not about the parser rejecting the register name outright
as was the case in the earlier reports:
If the EDG-side mapping for -Wdeprecated-class diagnostics on ARMv7-M
inline asm reports them at error severity instead of warning, that may
be the gap.
Notes
- GCC 15.2.1 also warns on this pattern:
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -O2 -Wall -Wextra emits -Wdeprecated for
the same code. The diagnostic is therefore not a false positive — but
the severity (error vs. warning) differs from what GCC reports.
- The
[-Wdeprecated] note from GCC reads: "the value of the stack
pointer after an 'asm' statement must be the same as it was before
the statement" — a valid ABI concern, but one that warrants a warning,
not an error-level block.
- The pattern is not exotic.
__set_PSP / __set_MSP are part of the
ARM-distributed CMSIS-Core headers used by every silicon vendor for
Cortex-M. Any CMSIS-based project hits this.
- The diagnostic is IntelliSense-only at error severity; real builds
with arm-none-eabi-gcc complete successfully.
Brief summary
Microsoft C/C++ Extension's IntelliSense (EDG parser) flags
spin aGCC inline asm clobber list as an error (severity 8) on ARM
(ARMv7-M / Cortex-M3). The underlying concern is real —
arm-none-eabi-gcc15.2.1 also flags the same pattern, but as awarning (
-Wdeprecated), not an error.The problem is the severity mismatch: vscode-cpptools elevates what
GCC treats as a deprecation warning to an error-level diagnostic in the
Problems panel, making it indistinguishable from a hard compile-blocking
error.
In any CMSIS-based Cortex-M3 project, every reference to
__set_PSP/__set_MSP— the standard CMSIS helpers incore_cmFunc.hdistributedby ARM and used by every silicon vendor (STM32, NXP, Nordic, ...) — is
flagged at error severity.
Steps to reproduce
repro.c(no vendor dependency):Minimal
.vscode/c_cpp_properties.json:{ "version": 4, "configurations": [{ "name": "Cortex-M3", "intelliSenseMode": "linux-gcc-arm", "compilerPath": "<path-to>/arm-none-eabi-gcc", "cStandard": "c11" }] }Open
repro.cin VS Code → IntelliSense underlines"sp"in bothclobber lists and reports the diagnostic at error severity in the
Problems panel.
Expected behavior
A warning-level diagnostic is acceptable — GCC itself emits
-Wdeprecatedfor this pattern. The expected behavior is thatIntelliSense reports this at warning severity (matching GCC), not at
error severity that visually masks real compile errors.
Actual behavior
IntelliSense reports the
sptoken in the clobber list atseverity 8 (error). The error squiggle appears in the editor and the
Problems panel for every translation unit that pulls in CMSIS
core_cmFunc.h(i.e. essentially every Cortex-M project that calls__set_PSP/__set_MSP).For comparison,
arm-none-eabi-gcc15.2.1 emits the same diagnostic atwarning severity:
The compile completes successfully (the diagnostic is
-Wdeprecated,not
-Werror=deprecated).Configuration and Logs
f6cfa2ea2403534de03f069bdf160d06451ed282)ms-vscode.cpptools1.32.2 (win32-x64)arm-none-eabi-gcc15.2.1 (2025-12-03 release)intelliSenseModelinux-gcc-armcStandardVS Code
C/C++: Log DiagnosticsandC/C++: Show Language Server Logoutputs were not captured in this initial report. They can be regenerated
and attached on maintainer request — the diagnostic is fully reproducible
on demand from the minimal example above and does not depend on any
workspace-specific state beyond the four-line
c_cpp_properties.jsonshown above.
Related closed issues
May be related to the same EDG behavior previously addressed for other
targets — though this issue is specifically about severity (error
vs. warning), not about the parser rejecting the register name outright
as was the case in the earlier reports:
fixedfixed(milestone 1.11.1)more info neededmore votes neededIf the EDG-side mapping for
-Wdeprecated-class diagnostics on ARMv7-Minline asm reports them at error severity instead of warning, that may
be the gap.
Notes
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -O2 -Wall -Wextraemits-Wdeprecatedforthe same code. The diagnostic is therefore not a false positive — but
the severity (error vs. warning) differs from what GCC reports.
[-Wdeprecated]note from GCC reads: "the value of the stackpointer after an 'asm' statement must be the same as it was before
the statement" — a valid ABI concern, but one that warrants a warning,
not an error-level block.
__set_PSP/__set_MSPare part of theARM-distributed CMSIS-Core headers used by every silicon vendor for
Cortex-M. Any CMSIS-based project hits this.
with
arm-none-eabi-gcccomplete successfully.