On Wed, Mar 15, 2023 at 11:23:05AM +0000, Taylor R Campbell wrote:
> Proposal: Forbid extern declarations in .c files.
> 
> extern declarations in .c files invite easily avoided bugs where the
> definition and use have mismatched types, because the compiler doesn't
> have an opportunity to check them.  Fix: Always put the extern
> declaration in a .h file shared by the .c file defining it and the .c
> files using it.
> 
> Pretty simple.  Any objections?

Maybe an exception could be made for functions defined in an assembly file and
used from a single C file ?

-- 
Manuel Bouyer <bou...@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

Reply via email to