VS Code Error vs Visual Studio 2019 Error - visual-studio-code

I Used VS code to write some code but the compiler is working only in the terminal. So I set up Visual Studio 2019 For C++ but get an error that I didn't get in VS Code. (I know the solution to the error):
The uninitialized local variable 'name' used
and the solution is Just adding these {} brackets to the variable.
Why is This Happening in Visual Studio 2019 and not in VS Code?
Note: I Installed "MinGW" for VS Code and desktop development with C++ for Visual Studio 2019.
Additional: I Want Visual Studio 2019 to Show unused scopes (#Include things) and help me to clean code.

Check your exception settings in Visual Studio (Ctrl + Alt + E) and/or your Warning Level on the Project file (right click on project in solution explorer, click Properties, C/C++ > General > Warning Level).
The warning/exception controls in Visual Studio are rather detailed.
The "warning that is now an error" issue related to The uninitialized local variable 'name' used simply comes down to the out-of-the-box settings in Visual Studio. You can change them if you'd like. Technically, your code will compile under every C++ compiler I'm aware of, but has a greater likelihood of crashing.
As for whether it should be a warning or an error, that is more opinion than fact. My opinion is that it should be an error, because such situations can lead to very sneaky program crashes, but there is no hard-and-fast rule.

Related

Trying to build My UE5 C++ Project in Visual Studio Code - it doesn't build in Visual Studio Code but builds in Visual Studio 2019 and UE Live Code

The project I'm working on in Visual Studio Code builds fine when you use the Live Code from The Unreal Editor but if you try to build from Visual Studio you get this in the terminal...
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
I'm assuming it is choking on the space in C:\Program Files (however that is a standard space in that Windows created directory so I can't change it without breaking links for countless other files in that directory). As well when you build from Unreal it doesn't choke on that space - so I'm wondering if anyone knows how to "ignore" the spaces. And since Visual Studio 2019 has no issues building that project - it must have some setting that is also ignoring the spaces. Thanks in advance.
(it doesn't seem to fail - it just seems to soft lock? the "thinking spinner" just keeps spinning and it never seems to complete the build task).
I brought the same project into Visual Studio 2019 and it builds fine, however I can't get Unreal's Live Code to link with 2019 so I'm just trying to get this working in Visual Studio Code since Live Code works great with it.

search analyzer and formatter for Visual studio code

I would like to find a linter to analyze the formatting of my code, and also use the linter locally to format my code. And I would want to be able to do that with Visual studio code (and ideally, also Visual studio).
Right now, I am using Visual studio with resharper. But it's way too slow for me.
So I installed visual studio code, installed the extension omnisharp and roslynator, to be able to have the same formatting rules as resharper. So it works well, I configured my config file to display error when a rule is not respected, like that :
My issue is, I can't find a way to fix all these issue with a shortcut, like I use to do with Visual studio and resharper.
The shortcut shift+alt+F does not fix all my errors, and the command omnisharp "fixall" act weirdly, it remove my function Hi..
Do you have suggestion of setup with visual studio code to be able to format the code directly (not via a command line, but from a shortcut), and as advanced as resharper, and that could also work as a linter to analyze the code on the CI?

Visual Code Studio with C/C++ extension: How to disable warnings

I'm working with Zephyr OS in the Visual Code Studio IDE.
Zephyr uses a lot of Macros but the C/C++ extension does not like that and throws Warnings.
One example of a warning you can see here on the screenshot "The function call is not allowed in a constant expression. C/C++(59)"
Do you probably now where I can add that warning to a kind of ignore/suppress list?
Many thanks!

How do I change Visual Studio Code line number settings to start at zero?

This is kind of for ease of use question since I'm writing assembly code and looking at machine code through Visual Studio Code as a text editor.
Is there anywhere in the settings of Visual Studio Code where I can change the starting line number to zero?

Running IBM Rhapsody animations without Visual Studio

I am relatively new to Rational Rhapsody, and SysML in general, so the errors are likely to be at my end.
I have been scouring Google (and SOF) looking for ways to run Rhapsody animations without Visual Studio. It was my impression that if Rhapsody had access to another IDE, say Eclipse, then the other IDE could deal with the animations. Is this correct, or is VS absolutely required to run animations and debugging tools in Rhapsody?
I have been getting a similar error to that of the user in How to fix Rational Rhapsody error :"Current value is "VC11", but no Visual Studio installation was not found in the directory ""."; my error is "VC10." However, I do not have, or plan to have, Visual Studio run the animations; I'd rather have the animations run using Eclipse, but this is not working either (the same "VC10" error occurs).
I also chatted with a contact at IBM and he suggested trying cygwin as a compiler, but under my circumstances, I cannot download that software.
Thanks in advance for the assistance.
The Rhapsody workflow:
Rhapsody generates code from your model. (UML => C++)
To compile the code you need a compiler. Rhapsody does not have its own compiler. If you are on Windows, you can use the VS or cygwin compiler. (C++ => EXE)
If you have enabled the animation instrumentation for your application, then if you start the application, it will connect (using TCP/IP) to a running Rhapsody instance. The animation will run in Rhapsody.
... is VS absolutely required to run animations and debugging tools in Rhapsody?
A compiler (eg. VS or cygwin) is absolutely required to compile the code that has been generated by Rhapsody. Rhapsody is required if you want to see animated state-charts or sequence-diagrams while your application is running.
See also: configure Rhapsody 8.x to use the VS 2013 compiler.
There are many different questions. I try to give you some clarifications.
To run your Rhapsody model with animation you need Rhapsody and a compiler. The compiler could be Visual Studio compiler or Cygwin gcc. Those frameworks are already provided by Rhapsody.
Visual Studio or Eclipse you only need to edit your code. This can easily be done with right klick on your configuration and change it to the corresponding IDE.
I guess you question is related to the VS Version. In the properties of your configuration you must adjust your Visual Studio version. Search for property with VCxx content. Can't remember the exact name of the property at the moment.