Date: Fri, 27 Nov 2026 15:42:46 +0100
On Fri, Nov 27, 2026 at 3:02 PM Alejandro Colomar <
une+cxx_std-proposals_at_[hidden]> wrote:
> Hi David, Simon,
>
> > Date: 2026-11-27 14:31:45+0100
> > From: David Brown via Std-Proposals <std-proposals_at_[hidden]>
> >
> >
> >
> > On 27/11/2026 14:12, Simon Schröder wrote:
> > >
> > > On Fri, Nov 27, 2026 at 1:57 PM David Brown via Std-Proposals <std-
> > > proposals_at_[hidden] <mailto:std-proposals_at_[hidden]>>
> > > wrote:
> > >
> > >
> > > For C, you could just have
> > >
> > > #define default
> > >
> > > and then include the "default" for clarity and portability. That
> would
> > > not force the use of "default", but it would at least allow it.
> > >
> > >
> > > C still has 'switch'. So, you shouldn't be doing that...
> >
> > Good point!
>
> Does C++ not have 'switch'? I see 8.5.3 "The switch statement" in
> n5054.
>
Yes, it does. The suggestion was that we reuse the 'default' keyword for
default parameters *only* in C++. '#define default' was just suggested
*only* for C, so that it would be eliminated for cross C/C++ function
declarations. This means that the #define does not apply to C++ code. (And
therefore, regular switch in C++ would be fine because we wouldn't define
away 'default'.)
>
> > I guess the obvious answer in C is to use _Default instead :-)
>
> Having default and _Default mean different things would be confusing.
>
You missed the smiley :-) . It was meant as a joke because of _Bool and the
like...
And it was not meant to mean different things, but the same thing.
>
>
> Cheers,
> Alex
>
> --
> <https://www.alejandro-colomar.es>
>
une+cxx_std-proposals_at_[hidden]> wrote:
> Hi David, Simon,
>
> > Date: 2026-11-27 14:31:45+0100
> > From: David Brown via Std-Proposals <std-proposals_at_[hidden]>
> >
> >
> >
> > On 27/11/2026 14:12, Simon Schröder wrote:
> > >
> > > On Fri, Nov 27, 2026 at 1:57 PM David Brown via Std-Proposals <std-
> > > proposals_at_[hidden] <mailto:std-proposals_at_[hidden]>>
> > > wrote:
> > >
> > >
> > > For C, you could just have
> > >
> > > #define default
> > >
> > > and then include the "default" for clarity and portability. That
> would
> > > not force the use of "default", but it would at least allow it.
> > >
> > >
> > > C still has 'switch'. So, you shouldn't be doing that...
> >
> > Good point!
>
> Does C++ not have 'switch'? I see 8.5.3 "The switch statement" in
> n5054.
>
Yes, it does. The suggestion was that we reuse the 'default' keyword for
default parameters *only* in C++. '#define default' was just suggested
*only* for C, so that it would be eliminated for cross C/C++ function
declarations. This means that the #define does not apply to C++ code. (And
therefore, regular switch in C++ would be fine because we wouldn't define
away 'default'.)
>
> > I guess the obvious answer in C is to use _Default instead :-)
>
> Having default and _Default mean different things would be confusing.
>
You missed the smiley :-) . It was meant as a joke because of _Bool and the
like...
And it was not meant to mean different things, but the same thing.
>
>
> Cheers,
> Alex
>
> --
> <https://www.alejandro-colomar.es>
>
Received on 2026-11-27 14:43:29
