Re: Need some advice on C semantics.

2024-12-18 Thread Janne Johansson
> I'm a newbie to C. But I saw that you mentioned undefined behavior. > Robert C. Seacord's book Effective C warns about undefined behavior in C > in the topics he discusses. Other books don't even mention it. Reasoning about what is and what was UB is kind of hard, since C started out to be a com

Re: Need some advice on C semantics.

2024-12-18 Thread Adrian Ali
On 12/17/24 9:17 PM, Christian Schulte wrote: 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 t

Re: Need some advice on C semantics.

2024-12-18 Thread Christian Schulte
On 12/18/24 06:46, Geoff Steckel wrote: > On 12/17/24 7:17 PM, Christian Schulte wrote: >> 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 clea

Re: Need some advice on C semantics.

2024-12-17 Thread Geoff Steckel
On 12/17/24 7:17 PM, Christian Schulte wrote: 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

Re: Need some advice on C semantics.

2024-12-17 Thread Christian Schulte
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, yo

Re: Need some advice on C semantics.

2024-12-13 Thread Dmitry O
The documentation is the "src" itself, there is no official guide. Also a very good approach would be to use advanced LLMs, just try to make a meaningful conversation with it and you will get a ton of information. On Thu, Dec 12, 2024 at 4:57 PM Christian Schulte wrote: > Hi @misc, > > is there

Re: Need some advice on C semantics.

2024-12-13 Thread Maxim
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 docu

Re: Need some advice on C semantics.

2024-12-12 Thread Janne Johansson
Den tors 12 dec. 2024 kl 16:57 skrev Christian Schulte : > I am quite tired now and will need some sleep. I will try to come up > with an example the next day. One using pointer syntax and a while loop > and one using array syntax and a for loop. The first will make the > compiler produce somethin

Re: Need some advice on C semantics.

2024-12-12 Thread Christian Schulte
On 12/12/24 16:38, Janne Johansson wrote: >> and things like that. In Java, we always had some CI server checking >> various design guidelines like >> >> A method should have only one return statement. >> >> and things like this. In C this is very different due to e.g. lack of >> exceptions and so.

Re: Need some advice on C semantics.

2024-12-12 Thread Janne Johansson
> and things like that. In Java, we always had some CI server checking > various design guidelines like > > A method should have only one return statement. > > and things like this. In C this is very different due to e.g. lack of > exceptions and so. I am still failing to find semantic design guide

Re: Need some advice on C semantics.

2024-12-12 Thread Claudio Jeker
On Thu, Dec 12, 2024 at 03:35:33PM +0100, Christian Schulte wrote: > On 12/12/24 12:13, Kirill A. Korinsky wrote: > > On Thu, 12 Dec 2024 11:54:29 +0100, > > Christian Schulte wrote: > >> > >> is there something specific for OpenBSD like style(9) but for semantics? > >> I understand that style(9)

Re: Need some advice on C semantics.

2024-12-12 Thread Christian Schulte
On 12/12/24 12:13, Kirill A. Korinsky wrote: > On Thu, 12 Dec 2024 11:54:29 +0100, > Christian Schulte wrote: >> >> is there something specific for OpenBSD like style(9) but for semantics? >> I understand that style(9) is all about syntax. As a long term Java >> developer having lost all interest

Re: Need some advice on C semantics.

2024-12-12 Thread Kirill A . Korinsky
On Thu, 12 Dec 2024 11:54:29 +0100, Christian Schulte wrote: > > is there something specific for OpenBSD like style(9) but for semantics? > I understand that style(9) is all about syntax. As a long term Java > developer having lost all interest in Java, I am searching for something > like PMD, Ch