Hi Detlef,

On Sat, Nov 21, 2026 at 2:37 PM Detlef Riekenberg <[email protected]> wrote:
>
> On Fri, 20 Nov 2026 21:12:47 +0000, Christopher Bazley wrote:
>
> > Dear TCC developers,
> >
> > I pushed 205f264b9e01 to mob earlier. It adds -Wnull-to-nonoptional,
> > which warns when a null pointer constant is implicitly converted to a
> > pointer whose target type lacks the _Optional qualifier. The warning
> > is off by default because such conversions are commonplace;
>
> > Thanks,
> > Christopher
>
> Hi Christopher.
>
> "_Optional" is still not in a public working draft for the upcoming C2y 
> standard,
> just on the Agenda of the latest WG14 meeting (which was 16.11.2026 - 
> 20.11.2026).
> The Editor's Report is not online yet and the proposal is password protected.
> Neither clang nor gcc have the mentioned warning switch.

That's correct for the official releases of Clang and GCC. _Optional
is currently the subject of a draft Technical Specification, ISO/IEC
DTS 26716, rather than part of C2y. My Clang fork implements both the
qualifier and the warning, and SDCC has supported the qualifier since
version 4.6.0.

> In addition, tcc should be small and fast.

Supporting _Optional has little impact on TCC's size or compilation
speed, as far as I can tell. The feature was specifically designed to
reuse existing type qualifier handling. I also paid close attention to
efficiency: for example, I allocated bits so that the combined
qualifier mask remains encodable as an AArch32 immediate operand.

> Is this new C2y feature (when it was accepted for inclusion this week)
> the right feature to be implemented in current tcc?
>
> Currend tcc is a release candidate.
> When will we get a release, when new features are added again and again?

I've now read your separate email calling for a release, and I
understand your concern. I agree that TCC needs a release, and I
certainly don't want my contributions to delay it.

I have been treating mob as a development branch. Would it be possible
to establish a release branch or select an earlier commit for
branching 0.9.28? That would allow stabilisation to proceed
independently of further development on mob, without requiring
features to be reverted from the development branch.

> I would prefer to revert anything related to "_Optional" and the new warning 
> switch in current tcc now.

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 that I have been able to fix.
Without _Optional support, those projects would no longer compile with
an unmodified TCC, and that source of testing would be lost.

The implementation is relatively small, reuses TCC's existing type
qualifier support, and has dedicated regression tests. Testing
_Optional has also exposed defects in the handling of existing
qualifiers. I don't think it follows that reverting the feature would
necessarily improve reliability.

Some of the related commits fix independent bugs or implement other
C23 functionality, so reverting everything together would also discard
unrelated improvements.

I would be happy for _Optional to be excluded from the forthcoming
release if that helps get 0.9.28 published; however, I hope the work
can remain available on the development branch, where I can continue
using it to test TCC against real-world projects.

Best,
Christopher

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

Reply via email to