Re: Feature request for "friendship" of pointers in "C"

2020-03-18 Thread Florian Weimer
* aotto: > Hi, the following scenario has a "definition hole" in the "C" language > > code example: > > - > struct base { >   ... > }; > > struct A { >   struct base obj; >   ... > } aObj; > > struct B { >   struct base obj; >   ... > } bObj; > > void method_base (stru

Re: Feature request for "friendship" of pointers in "C"

2020-03-18 Thread Andreas Schwab
On Mär 17 2020, Holger Lamm wrote: > ANSI C 6.5.8 (5) confirms that "... pointers to structure members > declared later compare greater than pointers to members > declared earlier in the structure"; I found no definition of address > to structure vs. address of structure member but t

Re: Feature request for "friendship" of pointers in "C"

2020-03-17 Thread Holger Lamm
Am 17.03.20 um 22:41 schrieb Andreas Schwab: On Mär 17 2020, Holger Lamm wrote: No. The order of elements of structures in memory is implementation defined and not guaranteed to be the order of enumeration in the definition. That is not true. The first member is guaranteed to have the same a

Re: Feature request for "friendship" of pointers in "C"

2020-03-17 Thread Andreas Schwab
On Mär 17 2020, Holger Lamm wrote: > No. The order of elements of structures in memory is implementation > defined and not guaranteed to be the order of enumeration in the > definition. That is not true. The first member is guaranteed to have the same address as the whole structure, and subseque

Re: Feature request for "friendship" of pointers in "C"

2020-03-17 Thread Holger Lamm
Hi, Am 02.02.20 um 08:44 schrieb aotto: Hi, the following scenario has a "definition hole" in the "C" language code example: - struct base { ... }; struct A { struct base obj; ... } aObj; struct B { struct base obj; ... } bObj; void method_base (struct base

Feature request for "friendship" of pointers in "C"

2020-02-01 Thread aotto
Hi, the following scenario has a "definition hole" in the "C" language code example: - struct base {   ... }; struct A {   struct base obj;   ... } aObj; struct B {   struct base obj;   ... } bObj; void method_base (struct base * hdl, ...); method_base(&aObj, ...) met