Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #168287

Re: complex problem with gcc usage

From aotto1968 <aotto1968@t-online.de>
Newsgroups comp.lang.c
Subject Re: complex problem with gcc usage
Date 2022-11-19 19:19 +0100
Organization A noiseless patient Spider
Message-ID <tlb6ns$398db$1@dont-email.me> (permalink)
References <tl8eo4$2vpv0$1@dont-email.me> <20221118115253.118@kylheku.com> <tla4vb$36ma1$1@dont-email.me>

Show all headers | View raw


This works for "C" and "C++" but I'll not use this, because…

   /// cast a \e known-object into an \RMkNs{ObjectS} reference
   #define   MkOBJ_R(x)        (*(x)).super.obj
   /// cast a \e known-object into an \RMkNs{ObjectS} pointer
   #define   MkOBJ(x)          ((sizeof(*(x)) == sizeof(struct MkObjectS)) ? ((MK_OBJ)(x)) : &(*(x)).super.obj)

1. it does NOT work for reference
2. require HARD cast for success → this break compile-time-type-safty
3. "sizeof" as indicator is to "slippy" because unequal types COULD still have same size (alignment-problem)

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

complex problem with gcc usage aotto1968 <aotto1968@t-online.de> - 2022-11-18 18:17 +0100
  Re: complex problem with gcc usage Kaz Kylheku <864-117-4973@kylheku.com> - 2022-11-18 20:03 +0000
    Re: complex problem with gcc usage aotto1968 <aotto1968@t-online.de> - 2022-11-19 09:43 +0100
      Re: complex problem with gcc usage Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2022-11-19 14:39 +0000
      Re: complex problem with gcc usage Kaz Kylheku <864-117-4973@kylheku.com> - 2022-11-19 16:13 +0000
      Re: complex problem with gcc usage aotto1968 <aotto1968@t-online.de> - 2022-11-19 19:19 +0100
        Re: complex problem with gcc usage Kaz Kylheku <864-117-4973@kylheku.com> - 2022-11-19 21:42 +0000
      Re: complex problem with gcc usage Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-11-19 14:34 -0800
        Re: complex problem with gcc usage aotto1968 <aotto1968@t-online.de> - 2022-11-20 08:40 +0100
        Re: complex problem with gcc usage Kaz Kylheku <864-117-4973@kylheku.com> - 2022-11-20 15:09 +0000
  Re: complex problem with gcc usage "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-11-18 12:10 -0800

csiph-web