Thursday, 4 June 2026

Visual Studio 2026

Visual Studio 2026 is now out. Previous versions are no longer supported.

C/C++ on VS Code

You can edit C/C++ code in VS Code but you need the C/C++ Extension Pack for more features.

gcc on Windows

gcc on Windows can be used from WSL2. 

gcc --version

gives you the version you are using and the operating system.

gcc versions can be found here.

The C ABI

 The C ABI refers to the C Application Binary Interface.

This will differ depending on platform.

Platform specific ABI specifications include:

x64 ABI Conventions

ABI for Unix/Linux

Very important for C/C++ and assembly programmers.

C++ Value Categories

Every Win Joe knows an lvalue when they see one, but there are subtleties.

glvalue
prvalue
xvalue

Recap here (from cppreference.com).

Flags for cl.exe

cl /EHs 

enable C++ EH (no SEH exceptions)

SEH (Structured Exception Handling) is a Windows-specific mechanism for handling system-level exceptions e.g. access violations or hardware faults, using __try, __except and __finally. It is not part of the C++ standard.

cl /EHc

extern "C" defaults to nothrow

Explanation: extern "C" tells the compiler to use C linkage (C-style symbol names, no name mangling), and by virtue of defaulting to "C mode" we don't have exceptions (the C ABI has no concept of exceptions). 

So extern "C" functions therefore  implicitly move from:

extern "C" void foo();

to:

extern "C" void foo() noexcept;

noexcept was introduced in C++11.

Wednesday, 3 June 2026

The Return of C++

The Microsoft C/C++ Optimizing Compiler is making a comeback. 

Building an EXE with a decent UI is as easy as this two step process:

1. Opening "Developer Command Prompt" in Windows (hit windows key and type "Developer..")

2. cl /EHsc mySuperUI user32.lib gdi32.lib

Bye bye heavy frameworks which rely on Windows API functions anyway.