User Tools

Site Tools


programming:visual_studio:configure_visual_studio

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
programming:visual_studio:configure_visual_studio [2023/06/25 17:42] peterprogramming:visual_studio:configure_visual_studio [2023/06/25 17:47] (current) peter
Line 2: Line 2:
  
 Within .vscode, Within .vscode,
 +
 +Add some more compiler arguments (also called flags) to tasks.json.
  
 <code json tasks.json> <code json tasks.json>
Line 40: Line 42:
 } }
 </code> </code>
 +
 +<WRAP info>
 +**NOTE:**
 +
 +  * The arguments **-Wall**, **-Wextra**, **-Wconversion**, **-Wsign-conversion**, and **-Wshadow** will instruct the compiler to warn us about many different types of common mistakes.
 +    * VS Code will then display these warnings right in the editor.
 +    * This is an incredibly useful feature, which will automatically detect and help prevent potential bugs in our code.
 +    * Never develop any C or C++ program without turning on all of these warning flags!
 +
 +  * In addition, **-Wpedantic** and **-std=c23** will instruct GCC to comply with the ISO C23 standard, the most recent standard, which will ensure that our program is maximally portable and can be compiled on other standards-complying compilers without too much hassle.
 +
 +  * On Windows only, we should add the flag **-D__USE_MINGW_ANSI_STDIO=1**, which will ensure that printing to the terminal follows the C standard.
 +
 +</WRAP>
 +
 +
 +
  
 ---- ----
Line 74: Line 93:
 } }
 </code> </code>
 +
 +<WRAP info>
 +**NOTE:**  The string **${workspaceFolder}** will automatically be replaced with the current workspace folder, so this will configure debugging sessions so that your program opens files from that folder.
 +</WRAP>
  
programming/visual_studio/configure_visual_studio.1687714947.txt.gz · Last modified: 2023/06/25 17:42 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki