Closed CieroCeramics closed 3 years ago
Yeah, this lists thousands of problems in my projects, and they're all false positives. It makes the Problems log useless, because it's too expensive to sift through thousands of false positives to try to find a couple accurate Problem reports.
@WardenGnaw
Just to be clear: the issue is the cpp tools assume all projects are compiled with #define UNICODE. So any project that compiles as multibyte gets every char vs TCHAR flagged as a Problem. That can easily be thousands of false positives in a medium size perfect. Even in a small project it can be hundreds, which skews the signal to noise ratio of the Problems log to the point of being unusable.
There needs to be a way to tell the cpp tools whether the project is Unicode or multibyte.
FOUND IT!
The FAQ mentions that preprocessor directives can be edited via the C/C++ Edit Configurations (UI)
command. Invoking that command reveals that UNICODE
and _UNICODE
are listed by default. I've removed them and anticipate that will resolve the issue.
I feel it would be beneficial if the documentation more overtly called out that the UNICODE vs ANSI compile "mode" issues can be resolved by editing the preprocessor configuration there. Yes, it's possible to find it if you know what you're looking for, but it's still pretty hidden.
@CieroCeramics We thought this issue was a debugger bug, but according to @chrisant996 it sounds like a language service configuration issue that is resolved as @chrisant996 describes. Can we close this issue?
@chrisant996 I don't fully understand what doc change would be best. You could file a doc issue at https://github.com/microsoft/vscode-docs/issues . The default defines are shown at https://code.visualstudio.com/docs/cpp/config-msvc#_cc-configurations .
thank you @chrisant996 for being so keen on this issue. it was absolutely impossible to include DevIL as an image library for my rendering engine. @sean-mcmanus it has been a fair amount of time since I have looked at this file. but I recall editing the configurations and it still not fixing the issue. to be honest the rendering engine hasn't been a priority at the moment. however, I am so close to escaping the use of Visual studio proper for C++ graphics applications. so I still want to check. I'll have to locate some of my un committed changes and I'll provide you with an update.
@CieroCeramics We thought this issue was a debugger bug, but according to @chrisant996 it sounds like a language service configuration issue that is resolved as @chrisant996 describes. Can we close this issue?
The defines
property solved the issue for me. But I'm having to manually clean it up in every project, because each project had UNICODE injected into it. I can sort of understand that approach, except that since defines
appeared to be empty I didn't know the UNICODE value was being stamped into every project.
@chrisant996 I don't fully understand what doc change would be best. You could file a doc issue at https://github.com/microsoft/vscode-docs/issues . The default defines are shown at https://code.visualstudio.com/docs/cpp/config-msvc#_cc-configurations .
What could have made things much more straightforward and understandable would have been if the Settings UI showed the actual default value, instead of empty.
defines
isn't set in any of the many places it could be set.defines
, instead of empty.Hey @sean-mcmanus, this issue might need further attention.
@CieroCeramics, you can help us out by closing this issue if the problem no longer exists, or adding more information.
This issue has been closed automatically because it needs more information and has not had recent activity.
Type: Debugger
The debugger is still giving me an error : "message": "argument of type \"char \" is incompatible with parameter of type \"wchar_t \"", this error is not processed by the build. when I switch the project encoding to UNICODE the error DOES show up in the build log and the compile fails. as expected however switching back to multibyte the build compiles the program correctly while in the "Problems" log remains the error message. not the worst thing but it does get distracting and I would like it to go away.
I am using ms build with .vcxproj files to build my project. but the settings.json and the .vcxproj files specify UTF-8
Steps to reproduce the behavior: