Hello /tccm,

On Sat, Nov 21, 2026 at 5:08 PM <[email protected]> wrote:
>
> Hello Christopher,
>
> On Sat, Nov 21, 2026 at 10:51:54AM +0000, Christopher Bazley wrote:
> > > which refers as a motivation to the author's own proposal
> > > (without disclosing the authorship, calling it instead a "draft ISO/IEC")
> > >
> ...
> > I wrote the _Optional proposal and the committee draft cited in the
> > commit message, WG14 N3951
>
> I am glad that we agree on this point.
>
> > > and also names a second reason: to make tinycc follow SDCC behavior.
> > >
> > > Neither of those reasons look sufficient to me, especially given that
> > > the same person have been active in support of _Optional in SDCC.
>
> > but Philipp Krause led the work in SDCC,
> > not me. He proposed adding the qualifier there so SDCC could warn
> > about missing null checks:
> >
> > https://sourceforge.net/p/sdcc/feature-requests/1003/
>
> Nevertheless, it looks like you have been and are actively involved in the
> corresponding implementation of _Optional there, judging from the commits.

I did not implement _Optional in SDCC 4.6.0, although I have
contributed to its subsequent development. Most of my SDCC patches
concern other aspects of the compiler.

> Your use of the SDCC project as a reference without disclosing your
> involvement there made me uncomfortable.

I take your point about transparency. I did not deliberately conceal
my involvement in SDCC development, but I had not appreciated that you
would consider it relevant when evaluating my TCC patches.

I also contribute to GCC professionally. For example, my work on GCC's
basic-block SLP vectoriser, including support for predicated tails, is
unrelated to _Optional:

https://www.mail-archive.com/gcc-patches%40gcc.gnu.org/msg418980.html

> > SDCC's developers believe that _Optional is the best fit for the
> > language and for their compiler.
>
> Those beliefs are not relevant here.
> Tinycc is a separate compiler, with different uses, users, developers
> and with its own criteria.

I agree that TinyCC's developers must make their own decisions.

> > a side-effect of  implementing and testing
> > _Optional has been to discover and fix bugs in [...] handling of
> > qualified types.
>
> Bug fixing is useful, please do.
>
> But please do not use this as an excuse to enforce new functionality,
> at a cost.
>
> Features are easy to add, hard to remove. Tinycc can only stay tiny by
> being cautious.

My contributions to fixing unrelated TCC bugs are not conditional on
support for _Optional being retained and my interest in TCC extends
beyond that. For example, I have recently been making an audit of how
various compilers behave when ISO C2Y constraints are violated, and
fixing bugs discovered as a result. This is relevant to my work as
part of WG14's undefined behaviour study group. The audit has already
identified several potential TCC defects.

> > I believe my commits give a lot of value relative to their size.
>
> Of course you believe in the usefulness of the extension - your brainchild
> (I do have full respect for this).

Thanks, although a few of my colleagues also contributed to the design.

> Still, not least for that very reason, your belief is not an argument.
>
> > Yes, N3951 is password-protected. That is annoying, but unfortunately
> > the committee manager tells me that ISO's rules require it.
>
> Oh. I did not spot any other encrypted file there in
> https://www.open-std.org/JTC1/SC22/WG14/www/wg14_document_log

A recent example is "2024/12/15 Kleynhans, TS 6010 A Provenance-aware
Memory Object Model for C, DTS Draft":

https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3417.pdf

> If the standardizing committee itself does not want the current
> proposal to be public, tinycc should hardly be bothered by following a
> hidden target, explainable only via yourself.
>
> > There is a bit of a "chicken and egg" problem with how the C committee
> > works. The committee asks "Has the feature been deployed in a
> > compiler?" whilst compiler maintainers ask "Has the feature been
> > approved by the committee?"
>
> This looks almost like as if you were using tinycc to build a case for the
> standardizing committee that, given SDCC and tinycc, "multiple compilers
> support the proposal's functionality".

Implementation experience is valuable to WG14, particularly because it
exposes problems that cannot always be anticipated from a
specification. Given that _Optional was designed from the beginning
with small compilers in mind, TinyCC seemed a particularly appropriate
compiler in which to evaluate it.

> Hinting in the commits to authority of "ISO draft" and to SDCC,
> without telling about your own stake there, strengthens unfortunately
> this impression.

For context, I explained in my first email to this list, on 6
September, that I was a member of WG14 and was prototyping support for
_Optional in TCC:

https://www.mail-archive.com/[email protected]/msg11764.html

> I see your additions as a danger for the direction of the tinycc
> project. All of us have to carry the added extra code, for a possible
> future language feature which is not even finalized.

_Optional is already implemented and used, rather than being merely a
hypothetical feature. Its specification has reached the draft
Technical Specification stage, although it has not yet been published
as an ISO document. Getting it to that stage is not insignificant.

TinyCC already supports numerous non-ISO extensions, including
statement expressions, computed gotos, cleanup attributes and GNU
inline assembly. I think the question should not be whether _Optional
is part of ISO C, but whether its benefits justify its implementation
and maintenance costs. The implementation of _Optional is relatively
small and makes extensive use of existing type-qualifier code, so I
thought it met those criteria.

> You might want to put your changes into your own branch or repository,
> to be able to present the compiler support to the committee, without it
> looking like tinycc is endorsing it.
>
> ( You have apparently a clang fork, why not do the same with tinycc?

Yes, I could maintain a separate branch. I contributed the
implementation upstream because TinyCC already supports extensions for
compatibility with other compilers, and I thought _Optional would be a
useful addition on similar grounds.

>   On Sat, Nov 21, 2026 at 04:01:16PM +0000, Christopher Bazley wrote:
>   > [...] My Clang fork [...]
> )
>
> > My reason for favouring support in TCC itself is that SDCC already
> > accepts _Optional.
>
> 1. Tinycc was already fully compatible with sources who use _Optional,
> via -D_Optional= .

That is a useful compatibility workaround, but it erases the type
distinction and the associated diagnostics. It is not equivalent to
implementing the qualifier. TCC's compilation speed makes these
diagnostics especially useful during development, before running the
other compilers in CI. The last thing I want to do is to harm that.

> 2. SDCC and tinycc are not related to each other except by being
> two quite different C compilers.

I agree that they are different compilers with different strengths,
but that does not make compatibility irrelevant.

> 3. The possible usefulness of interpreting _Optional in the compiler is
> known only from your point of view. Until now nobody else on this list
> has asked for the extension.
>
> As a compiler user, I do not need nor expect extensive checking of C
> code by tinycc. There are other more specific tools for such a purpose.
> I need and appreciate tinycc's compactness and speed.

Type qualifiers already allow TCC to check conversions that would
otherwise be difficult to diagnose. _Optional extends that existing
facility without requiring extensive static analysis. I have no
intention of turning TCC into a heavyweight static analyser.

> On Sat, Nov 21, 2026 at 04:01:16PM +0000, Christopher Bazley wrote:
> > I would be reluctant to revert _Optional from mob because that would
> > also have a cost: I currently compile my C projects with TCC; doing so
> > has exposed unrelated compiler bugs
>
> Your contribution to bugfixing is conditional on tinycc's upstream
> following the specifics of your projects - this is unfortunate.
>
> I think it is fair to accept the loss and thank you for cooperation thus far.
>
> I would appreciate if you revert the changes in mob, beginning with
> https://repo.or.cz/tinycc.git/commit/8b58a07b95a637e6d9060b4c26bc0f2e7758f1a4

Before I do that, I would welcome grischka's view, as well as those of
other TinyCC developers, on whether support for _Optional can remain
on mob.

If a revert is the consensus opinion, I would like to ensure that
independent bug fixes and C23 improvements are preserved.

Thanks,

Christopher

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to