Bfyuvf
Bfyuvf

Reputation: 149

Make vscode think raw strings are valid in C

For example, if this is in a C file:

#include <stdio.h>

int main() {
    puts(R"(PREPROCESSOR DIRECTIVES
The following are the preprocessor directives in C:
#define  - Replaces parts of the code. Non-function macros are usually named in UPPERCASE.
#include - Inserts a header file into the current file.
#ifdef   - Runs more preprocessor directives below until reaching an #endif, if something is defined.)");
}

it probably has bad practices I just made this quickly

It runs fine, but vscode bombards me with 7 useless errors. Sure, vscode lets it compile, but it's just annoying to see your errors tab full of fake errors. How can I fix it?

My question is "how can I make vscode not throw errors about raw strings" not "how can I make C have raw strings" if it wasn't clear already

Upvotes: 2

Views: 493

Answers (1)

bolov
bolov

Reputation: 75853

Raw strings are not standard C. I see they are accepted by gcc so that seems to be a gcc extension. What is happening is that you compile with gcc, but realtime error highlight system (intellisense, squiggles, whatever it is called) uses either a clang based solution or Visual Studio one.

Upvotes: 1

Related Questions