Hi tccm,

On Sat, Nov 21, 2026 at 9:32 AM <[email protected]> wrote:
>
> Sorry for talking to myself, more data:
>
> On Sat, Nov 21, 2026 at 08:50:48AM +0100, [email protected] wrote:
> > On Fri, Nov 20, 2026 at 09:12:47PM +0000, Christopher Bazley wrote:
> > > The compiler changes are small
> >
> > Still, it has grown 25 lines plus about a hundred lines in tests and
>
> Actually much _more_ code has been added in multiple commits, beginning
> with
>
> 8b58a07b95a637e6d9060b4c26bc0f2e7758f1a4
> "tccgen: add _Optional qualifier support"

The 25 lines I quoted were additions to tccgen.c in the warning commit
alone. The initial _Optional commit added 88 lines and removed 12
across the compiler sources (net +76 lines). Across all six commits
from the parent of that commit through 205f264b9e01, the diff adds 182
lines and removes 59 in the compiler itself (net +123 lines). It also
adds 912 lines under tests, including expected output and Makefile
changes, and adds 23 lines and removes one in the manual. That range
includes the array-type changes and typeof_unqual support.

> which refers as a motivation to the author's own proposal
> (without disclosing the authorship, calling it instead a "draft ISO/IEC")
>
> 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.

I wrote the _Optional proposal and the committee draft cited in the
commit message, WG14 N3951, 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/

SDCC's developers believe that _Optional is the best fit for the
language and for their compiler.  My proposal also received
enthusiastic support at WG14: the 69th meeting of WG14 (Strasbourg,
22-25 January 2024), voted 15/0/6 in favour of adding something along
the lines of N3089. Martin Uecker and I later co-authored N3952, which
records comments from Jens Gustedt and Alex Celeste on how well the
new qualifier fits C's type system.

The compatibility benefit for TCC is that code written for SDCC can
use the same declarations and headers in both compilers. TCC can also
use the qualifier in those declarations to diagnose mistakes at a call
site, even when the function is defined in another translation unit.
In both compilers, a side-effect of  implementing and testing
_Optional has been to discover and fix bugs in their handling of
qualified types.

I believe my commits give a lot of value relative to their size.

Christopher

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

Reply via email to