Open GuigzLab opened 3 days ago
@GuigzLab What version of g++? Can you confirm that it doesn't repro with 1.21.6? What is the minimal repro code? Does it repro with
#include <cstddef>
size_t i;
If you use Go to Def on cstddef are you able to locate the first file that shows an error? And/or use Go to Def on size_t. That could help locate the source of issue the issue that is causing the definition of size_t to not be parsed.
@GuigzLab What version of g++?
g++ version is g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Can you confirm that it doesn't repro with 1.21.6? What is the minimal repro code? Does it repro with
include
size_t i;
It doesn't repro with that code, minimal repro code is with #include <gdal_priv.h>
in my case but any lib that redefines size_t will do it
If you use Go to Def on cstddef are you able to locate the first file that shows an error? And/or use Go to Def on size_t. That could help locate the source of issue the issue that is causing the definition of size_t to not be parsed.
When only using cstddef it works fine, but any time I include a library containing a redefinition of size_t i get an error, with gdal I get this when hovering a _sizet
typedef <error-type> size_t(<error-type>)
Callback used by VSIStdoutSetRedirection()
So if I try to use it in a for loop for example, it will display errors, unless I use std::size_t but I would have to change files I don't have access to...
for (size_t i = 0; i < 10; i++)
{
std::cout << i << std::endl;
}
Gets me this error: function "i" may not be initializedC/C++(145)
Here is what's in the header, in file cpl_vsi.h from gdal lib:
/** Callback used by VSIStdoutSetRedirection() */
typedef size_t (*VSIWriteFunction)(const void *ptr, size_t size, size_t nmemb,
FILE *stream);
Environment
Bug Summary and Steps to Reproduce
Hi, I recently started to experience an issue using vscode IntelliSense, size_t :
identifier "size_t" is undefined C/C++(20)
I'm compiling fine though.
I'm using vscode in a docker using the Dev Containers extension.
I tried adding this part from this issue but nothing changed:
Depending on the files I'm working on, I either get _identifier "sizet" is undefined or It's linked to a redefinition of size_t from different modules (gdal, curl...)
Configuration and Logs
Other Extensions
Dev Containers
Additional context
No response