Re: [DNG] semantic of sizeof operator in C

2019-06-15 Thread s
On Thu, 13 Jun 2019 08:31:48 +0200 aitor wrote: > En 13 de junio de 2019 7:45:48 Didier Kryn escribió: > > > Le 12/06/2019 à 19:12, s@po a écrit : > >> First of all, I think that this subject derailed to a diferent subject. > >> > >> > >> > >> > >> I Apologise for give my opinion on a concrete

Re: [DNG] semantic of sizeof operator in C

2019-06-12 Thread aitor
En 13 de junio de 2019 7:45:48 Didier Kryn escribió: Le 12/06/2019 à 19:12, s@po a écrit : First of all, I think that this subject derailed to a diferent subject. I Apologise for give my opinion on a concrete subject, because, I never felt it would turn out "to be almost personal.." Ne

Re: [DNG] semantic of sizeof operator in C

2019-06-12 Thread Didier Kryn
Le 12/06/2019 à 19:12, s@po a écrit : First of all, I think that this subject derailed to a diferent subject. I Apologise for give my opinion on a concrete subject, because, I never felt it would turn out "to be almost personal.."     Never saw anything personal here and the discussion trigge

Re: [DNG] semantic of sizeof operator in C (was: simple-netaid from scratch)

2019-06-12 Thread John Morris
On Wed, 2019-06-12 at 08:40 -0400, Hendrik Boom wrote: > > More precisely, sizeof(foo) is the spacing of consecutive elements of > type foo. Most importantly for most people, malloc(sizeof(foo)*n) must not cause unexpected things like a kaboom. signature.asc Description: This is a digitally sign

Re: [DNG] semantic of sizeof operator in C

2019-06-12 Thread s
Hello guys, First of all, I think that this subject derailed to a diferent subject. I Apologise for give my opinion on a concrete subject, because, I never felt it would turn out "to be almost personal.." My Opinion is based on the Idea that we should not create extra complications, When we are

Re: [DNG] semantic of sizeof operator in C

2019-06-12 Thread Didier Kryn
Le 12/06/2019 à 16:29, Irrwahn a écrit : More precisely, sizeof(foo) is the spacing of consecutive elements of type foo. -- hendrik Thank you Hendrik, that is indeed very aptly phrased! Just for the sake of completeness, the actual language definition takes the usual wordy but precise approach

Re: [DNG] semantic of sizeof operator in C (was: simple-netaid from scratch)

2019-06-12 Thread Irrwahn
Hendrik Boom wrote on 12.06.19 14:40: > On Wed, Jun 12, 2019 at 01:47:42PM +0200, Irrwahn wrote: > >> >> There is nothing wrong here. Gcc reports the size that is necessary to >> store an object of type sesqui_int, including any padding that has been >> applied, e.g. for alignment reasons. An arr

Re: [DNG] semantic of sizeof operator in C (was: simple-netaid from scratch)

2019-06-12 Thread Hendrik Boom
On Wed, Jun 12, 2019 at 01:47:42PM +0200, Irrwahn wrote: > > There is nothing wrong here. Gcc reports the size that is necessary to > store an object of type sesqui_int, including any padding that has been > applied, e.g. for alignment reasons. An array of n elements of that type > will in turn

Re: [DNG] semantic of sizeof operator in C (was: simple-netaid from scratch)

2019-06-12 Thread Irrwahn
Didier Kryn wrote on 12.06.19 12:15: [...] Hi Didier, please allow me to clear up some apparent misconceptions below. > >     What I meant in this discussion is that sizeof() allows to > calculate the number of elements of an array, because we make > assumptions on data layout, but this is a