Open WhoBrokeTheBuild opened 1 year ago
The EDG parser used for IntelliSense hasn't implemented the feature yet -- you can check the feature set implemented at https://en.cppreference.com/w/c/23 to track the progress, although it may take some delay before we can ship an update.
EDG C23 feature status here: https://docs.google.com/spreadsheets/d/1XGTWYSks6L_20aAi4XiS-3pyi2cS_z_k-NKAroelGX8/edit#gid=0
The chart here, https://en.cppreference.com/w/c/23, is out of date according to that spreadsheet. For example, the spreadsheet shows support for constexpr object defs and I am not seeing that in VSCode.
@JPHutchins that google docs link has write permissions.
Related on Stack Overflow: VS Code's C/C++ extension says the C23 true and false keywords are unidentified
Is there a update to this? It appears that per the Google Doc linked above, the C2X / EDG parser supports a few things that currently incorrectly throw errors in VSCode - most notably binary literals.
@markgoetz, which version of the extension are you using? I forget when we merged EDG 6.5 into our extension, but it's in 1.19.3 as far as I can tell.
EDG 6.6 should be in 1.20.0 and above.
I'm not sure how valuable keeping this bug open is for us though since we're not driving the implementation of individual C23 features, however, it looks like we do need to update our support to pass ms_c23 to EDG, as support for that switch was recently added and we're still clamped to ms_c17. @browntarik would you be able to prep a PR for that?
@markgoetz, which version of the extension are you using? I forget when we merged EDG 6.5 into our extension, but it's in 1.19.3 as far as I can tell.
EDG 6.6 should be in 1.20.0 and above.
I'm not sure how valuable keeping this bug open is for us though since we're not driving the implementation of individual C23 features, however, it looks like we do need to update our support to pass ms_c23 to EDG, as support for that switch was recently added and we're still clamped to ms_c17. @browntarik would you be able to prep a PR for that?
I am on 1.19.4 and still seeing the error.
@markgoetz can you share some code/screenshots and the output of running the C/C++: Log Diagnostics
command while the file with the error is active in the editor?
Sure!
-------- Diagnostics - 2/26/2024, 6:33:04 PM
Version: 1.19.4
Current Configuration:
{
"name": "Mac",
"includePath": [
"/Users/markgoetz/Documents/dev/gbdk/mygames/swifty-beams-gb/**",
"/Users/markgoetz/Documents/dev/gbdk/include/**"
],
"macFrameworkPath": [],
"cStandard": "c23",
"cppStandard": "c++23",
"intelliSenseMode": "macos-gcc-x64",
"configurationProvider": "ms-vscode.makefile-tools",
"browse": {
"path": [
"/Users/markgoetz/Documents/dev/gbdk/mygames/swifty-beams-gb/**"
],
"limitSymbolsToIncludedHeaders": true
},
"compilerPath": "/Users/markgoetz/Documents/dev/gbdk/bin/lcc",
"compilerPathIsExplicit": true,
"cStandardIsExplicit": true,
"cppStandardIsExplicit": true,
"intelliSenseModeIsExplicit": true,
"compilerPathInCppPropertiesJson": "/Users/markgoetz/Documents/dev/gbdk/bin/lcc",
"configurationProviderInCppPropertiesJson": "ms-vscode.makefile-tools",
"mergeConfigurations": false
}
Custom browse configuration:
{
"browsePath": [
"/Users/markgoetz/Documents/dev/gbdk/mygames/swifty-beams-gb/res/compiled",
"/Users/markgoetz/Documents/dev/gbdk/mygames/swifty-beams-gb/src"
],
"compilerArgs": [
"-debug",
"-c",
"-o",
"obj/rendering.o",
"src/rendering.c"
],
"compilerPath": "/Users/markgoetz/Documents/dev/gbdk/bin/lcc",
"windowsSdkVersion": ""
}
cpptools version (native): 1.19.4.0
Translation Unit Mappings:
[ /Users/markgoetz/Documents/dev/gbdk/mygames/swifty-beams-gb/src/level.c - source TU]:
Translation Unit Configurations:
[ /Users/markgoetz/Documents/dev/gbdk/mygames/swifty-beams-gb/src/level.c ]:
Process ID: 3618
Memory Usage: 11 MB
Includes:
/Users/markgoetz/Documents/dev/gbdk/include
/Users/markgoetz/Documents/dev/gbdk/include/gbdk
/Users/markgoetz/Documents/dev/gbdk/include/asm
/Users/markgoetz/Documents/dev/gbdk/include/asm/sm83
/Users/markgoetz/Documents/dev/gbdk/include/asm/z80
/Users/markgoetz/Documents/dev/gbdk/include/asm/mos6502
/Users/markgoetz/Documents/dev/gbdk/include/nes
/Users/markgoetz/Documents/dev/gbdk/include/sms
/Users/markgoetz/Documents/dev/gbdk/include/gb
/Users/markgoetz/Documents/dev/gbdk/include/msx
Frameworks:
/System/Library/Frameworks
/Library/Frameworks
Standard Version: c17
IntelliSense Mode: macos-clang-x64
Total Memory Usage: 11 MB
------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 80
I noticed "Standard version: c17" for the file I have open. Maybe I have something misconfigured?
I noticed "Standard version: c17" for the file I have open. Maybe I have something misconfigured?
Yes, something seems wrong here. I can confirm on macOS that c17 mode produces the error in your screenshot, and c23 mode does not, so getting the extension to use c23 for your source file seems to be what's blocking you from getting correct IntelliSense here.
The extension will not know how to get information from your lcc
compiler right now either (#6931 will give you more options when it is complete). For the time being, you may want to set "compilerPath": ""
to disable the extension's compiler querying attempts. You may also want to delete "configurationProvider": "ms-vscode.makefile-tools"
since it will also try to set the compiler to lcc
(which we don't understand). Please try those two things and let me know if it gets you any further. If not, we can try setting "C_Cpp.loggingLevel": "debug"
and checking your logs.
I changed the compilerPath and it seems to work! Thanks for the assistance!
constexpr
is also not supported
#ifndef PAGE_H
#define PAGE_H
constexpr unsigned long int PAGE_SIZE = 4096;
typedef struct Page
{
unsigned long int id;
char data[PAGE_SIZE];
unsigned long int items;
} Page;
#endif // PAGE_H
gcc-13 support it:
_BitInt also doesn't work
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
There was an issue (#10615) that allows you to select c23/gnu23 as your compiler version, but the actual new language features are not implemented yet. Obviously this stuff is bleeding edge, but I struggled trying to get it to work and I wanted to submit an issue.
I would be happy to work on adding these features to the C/C++ language server, but I would need to be pointed in the right direction.
Steps to reproduce:
void doSomething() { int * test1 = nullptr; bool test2 = true; // without #include
enum TestEnum test3 = TEST_ENUM_VALUE;
}
Other Extensions
No response
Additional context
No response