C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Labelled parameters

From: Thiago Macieira <thiago_at_[hidden]>
Date: Wed, 07 Jan 2026 13:28:01 -0300
On Wednesday, 7 January 2026 10:41:38 Brasilia Standard Time Frederick
Virchanza Gotham via Std-Proposals wrote:
> I include <Windows.h> in just one source file in the entire program, and I
> call that source file "windows_bomb_chamber.c", and then I export a few
> stub functions from that translation unit so that other source files can
> use the Win32 API.

Indeed. As a rule of thumb, we never include windows.h in a public header, or
a header at all if we can avoid it. If at all possible, it or X11/Xlib.h
should be the very last include in a given source file.

But that's not *always* possible, nor is everyone as careful as we are ("once
burned, thrice shy" and all). That means those macros will be visible when
including some other headers, something that hasn't been a problem so far for
libraries, which can just give a slightly or much different name to parameters.

And if we are serious about getting C to adopt this so we can use this in C
libraries too, the problem is actually bigger. If nothing else, WG14 is much
more conservative about breaking anything.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Data Center - Platform & Sys. Eng.

Received on 2026-01-07 16:28:08