I am not particularly opposed to using header units to solve C library problems, because my original proposal focused on things that explicitly serve C++ (and C). static inline is sometimes misused by code that only supports C++ as well. Moreover, tool support for header units is very poor; as far as I know, most build systems do not support it, so for now it is not a viable solution either. I am not quite sure whether the Clang SIMD headers can be compiled as header units to solve problem 2 https://github.com/llvm/llvm-project/issues/195661.


From: Std-Proposals <std-proposals-bounces@lists.isocpp.org> on behalf of Sebastian Wittmeier via Std-Proposals <std-proposals@lists.isocpp.org>
Sent: Monday, June 22, 2026 20:18
To: std-proposals@lists.isocpp.org <std-proposals@lists.isocpp.org>
Cc: Sebastian Wittmeier <wittmeier@projectalpha.org>
Subject: Re: [std-proposals] Proposal: Deprecate namespace-scope declarations that are declared both static and inline
 

We have a compatibility option: header units

 

They implicitly export internal linkage (static) functions.

 

So one avenue of improvement could be, whether imported internal linkage functions from header units are not equal to their external linkage counterparts.

 

A second avenue could try to improve the situation without header units. But this is more difficult without changes in C or in the libraries. For those cases (export inline static functions to a module) the compilers could start outputting recommendations for refactoring.


 

-----Ursprüngliche Nachricht-----
Von: Rainer Deyke via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Mo 22.06.2026 14:05
Betreff: Re: [std-proposals] Proposal: Deprecate namespace-scope declarations that are declared both static and inline
An: std-proposals@lists.isocpp.org;
CC: Rainer Deyke <rainerd@eldwood.com>;


On 6/22/26 13:23, Yexuan Xiao via Std-Proposals wrote:
> It seems that some C code likes to use static inline to indicate that a function should be inlined, but this is inconsistent with C++ conventions.

Given that the C code already exists and is already used from C++,
wouldn't it make more sense to give the C code C-like semantics in C++?


--
Rainer Deyke - rainerd@eldwood.com
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals