NXXX5
-fwrapv for Everyone - A Measured Approach to _Operators

Published Proposal,

Previous Revisions:
None
Authors:
Paper Source:
GitHub
Issue Tracking:
GitHub
Project:
ISO/IEC 9899 Programming Languages — C, ISO/IEC JTC1/SC22/WG14
Proposal Category:
Change Request, Feature Request
Target:
C2y/C3a

Abstract

Operator support is a contentious language feature that has long had opponents and detractors both inside and outside of C. Despite this, compilers and C standard Annexes have been deploying more and more compiler flag overrides that effectively act as operation overloading features but without any way for the user to control or manage what their implementations intend for any given set of types, mathematic in nature or not. Recently, a proposal — N3051 — proposed operators for the C standard. This proposal looks at the feature proposed in N3051, states its support for the feature, and then proceeds to highlight some issues with that proposed design. It then goes on to highlight a different design for operators based on an explicit, function-mappable, one-to-one entity which does not rob users who are wary of operators their ability to program in their preferred style while giving users with a wide variety of types the tools to tame their code bases — numerical and otherwise — safely and effectively.

1. Changelog

2. Introduction and Motivation

Meow. :3

Bark. :3