ThePhD / transparent-aliases

A test repository for Transparent Aliases (N2901).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Transparent Aliases for C

This repository contains examples and tests for Transparent Aliases in C (WG14 Document N2901). The implementation can be played with over at https://godbolt.org.

The goal of transparent function aliases is to provide a zero-overhead, compile-time level of indirection that allows a function to be given a different name that it's resulting symbol in libraries and executables, while simply being a renaming capacity for non-binary implementations.

The ultimate goal of Transparent Aliases is to allow for function declarations of a given name to keep working while they are silently upgraded by C Librarians (both C Standard Librarians and Normal Librarians). There are a number of examples in this repository that serve to test this theory, and as of right now all of the tests for determining if the Application Binary Interface (ABI) of a Shared Object / DLL on Windows, *Nix, and MacOS platforms show that it works.

Upgrading ABI is critical to the future of C on many platforms (September 2021 Presentation to WG14 - Standard C Committee), and since it will be a long time before there is a revolutionary break in both source and binary code for integer sizes, pointer widths, and more, it behooves us to now learn how to properly upgrade our libraries. It produces no extra symbols or data as compared to a by-hand, macro-based implementation of the same and has several benefits over a macro approach, such as featuring having proper scopes and respecting shadowing rules where macros do not.

About

A test repository for Transparent Aliases (N2901).


Languages

Language:CMake 100.0%