On 12/13/24 12:26, Maxim wrote:
> Christian Schulte, 2024-12-12 11:54 +0100:
>> is there something specific for OpenBSD like style(9) but for semantics?
> 
> I believe such document doesn't exist. As it's been suggested to you,
> reading and learning for the codebase comes closest.
> 
> However, you probably will be interested in general documentation on
> "C semantics". Look out for things like infamous UB (undefined
> behaviour), implicit type and arithmetic conversions (pitfalls of mixing
> signed and unsigned integers is one example), secure coding, etc.
> 
> A few pointers to get you started:
> -   C89/C99/C11/C17/C23 standards
>     (copies of final drafts are available online for free)
> -   SEI CERT C Coding Standards
> -   MISRA C
> -   "Expert C programming" by Peter van der Linden
> -   "How to C in 2016" by Matt Stancliff
> 
> Beware some advice and guidelines found in these documents will be very
> opinionated.

Thank you very much. That's indeed what I was looking for. Those
undefined behaviour pitfalls. This just does not exist in the Java
Virtual Machine specification - or - when something was not quite clear,
the next specification version just clarified things and the
specification got updated accordingly. Just like when the meaning of the
volatile keyword got reworked/changed. Stopped following Java evolution
after the acquision by Oracle due to the way fundamental Java principles
got broken. Sad story. 27 years of Java experience to throw away now.
Just glad there is C.

-- 
Christian

Reply via email to