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


Groups > comp.lang.c > #67120 > unrolled thread

C pointer semantics with dynamically allocated struct

Started by"Morten W. Petersen" <morphex@gmail.com>
First post2015-08-11 20:48 +0200
Last post2015-08-12 11:13 +0200
Articles 20 on this page of 231 — 23 participants

Back to article view | Back to comp.lang.c


Contents

  C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-11 20:48 +0200
    Re: C pointer semantics with dynamically allocated struct Melzzzzz <mel@zzzzz.com> - 2015-08-11 20:59 +0200
    Re: C pointer semantics with dynamically allocated struct Melzzzzz <mel@zzzzz.com> - 2015-08-11 21:03 +0200
      Re: C pointer semantics with dynamically allocated struct James Kuyper <jameskuyper@verizon.net> - 2015-08-11 15:32 -0400
    Re: C pointer semantics with dynamically allocated struct jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-11 21:03 +0200
      Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-11 21:47 +0200
    Re: C pointer semantics with dynamically allocated struct jt@toerring.de (Jens Thoms Toerring) - 2015-08-11 19:14 +0000
      Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-11 21:50 +0200
        Re: C pointer semantics with dynamically allocated struct James Kuyper <jameskuyper@verizon.net> - 2015-08-11 16:12 -0400
          Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-11 22:45 +0200
            Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-12 03:08 +0100
    Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-11 20:24 +0100
      Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-11 21:51 +0200
        Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-11 13:32 -0700
          Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-11 13:36 -0700
            Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-11 22:57 +0200
              Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-11 23:23 +0200
              Re: C pointer semantics with dynamically allocated struct Keith Thompson <kst-u@mib.org> - 2015-08-11 16:47 -0700
                Re: C pointer semantics with dynamically allocated struct glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-11 23:46 +0000
                  Re: C pointer semantics with dynamically allocated struct morphex@gmail.com (Morten W. Petersen) - 2015-08-12 02:05 +0200
                  Re: C pointer semantics with dynamically allocated struct Keith Thompson <kst-u@mib.org> - 2015-08-11 17:16 -0700
                  Re: C pointer semantics with dynamically allocated struct Richard Heathfield <rjh@cpax.org.uk> - 2015-08-12 01:11 +0100
                    Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-11 17:35 -0700
                      Re: C pointer semantics with dynamically allocated struct Richard Heathfield <rjh@cpax.org.uk> - 2015-08-12 01:51 +0100
                        Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-12 03:02 +0200
                          Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-11 19:50 -0700
                            Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-11 20:09 -0700
                            Music and programming (was: Re: C pointer semantics with dynamically allocated struct) "Morten W. Petersen" <morphex@gmail.com> - 2015-08-12 11:54 +0200
                              Re: Music and programming (was: Re: C pointer semantics with dynamically allocated struct) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-12 03:35 -0700
                                Re: Music and programming "Morten W. Petersen" <morphex@gmail.com> - 2015-08-12 13:00 +0200
                              Re: Music and programming Richard Heathfield <rjh@cpax.org.uk> - 2015-08-12 11:46 +0100
                                Re: Music and programming "Morten W. Petersen" <morphex@gmail.com> - 2015-08-12 13:06 +0200
                                  Re: Music and programming Richard Heathfield <rjh@cpax.org.uk> - 2015-08-12 13:08 +0100
                                  Re: Music and programming raltbos@xs4all.nl (Richard Bos) - 2015-08-12 12:18 +0000
                                    Re: Music and programming "Morten W. Petersen" <morphex@gmail.com> - 2015-08-12 14:26 +0200
                                      Re: Music and programming Richard Heathfield <rjh@cpax.org.uk> - 2015-08-12 13:36 +0100
                                        Re: Music and programming "Morten W. Petersen" <morphex@gmail.com> - 2015-08-12 15:13 +0200
                                        Re: Music and programming David Brown <david.brown@hesbynett.no> - 2015-08-12 16:10 +0200
                        Re: C pointer semantics with dynamically allocated struct crisdunbar@gmail.com - 2015-08-13 15:47 -0700
                      Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-12 04:52 -0700
                        Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-12 05:01 -0700
                          Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-12 05:10 -0700
                    Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-12 09:17 +0200
            Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-12 02:56 +0100
              Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-12 04:07 +0200
                Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-12 03:45 +0100
                  Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-12 12:10 +0200
                    Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-12 11:39 +0100
                      Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-12 13:41 +0200
                        Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-12 04:59 -0700
                          Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-12 14:16 +0100
                            Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-12 06:37 -0700
                              Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-12 15:34 +0100
                                Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-12 08:17 -0700
                                  Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-12 08:38 -0700
                                  Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-12 17:19 +0100
                                    Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-12 09:52 -0700
                                      Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-12 22:40 +0100
                                      Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-13 13:31 +0200
                                        Re: C pointer semantics with dynamically allocated struct Richard Damon <Richard@Damon-Family.org> - 2015-08-14 20:39 -0400
                                          Re: C pointer semantics with dynamically allocated struct Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-05 13:03 -0700
                                        Re: C pointer semantics with dynamically allocated struct Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-05 14:16 -0700
                                          Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-09-06 11:19 +0200
                                            Re: C pointer semantics with dynamically allocated struct Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-06 18:15 -0700
                                              Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-09-07 09:13 +0200
                        Re: C pointer semantics with dynamically allocated struct Richard Damon <Richard@Damon-Family.org> - 2015-08-12 08:07 -0400
                          Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-12 14:08 +0100
                      Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-12 10:24 -0700
                        Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-12 20:45 +0100
                          Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-13 04:19 +0200
                            Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-13 13:18 +0100
                              Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-16 15:43 +0200
                                Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-16 21:32 +0100
                                  Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 12:00 +0200
                                    Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-17 15:50 +0100
                                      Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 22:28 +0200
                                        Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-18 01:34 +0100
                                          Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-19 08:40 +0200
                      Re: C pointer semantics with dynamically allocated struct luser droog <luser.droog@gmail.com> - 2015-08-12 13:35 -0700
                        Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-12 15:01 -0700
                        Re: C pointer semantics with dynamically allocated struct Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-05 11:39 -0700
                          Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-09-06 11:24 +0200
                            Re: C pointer semantics with dynamically allocated struct Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-06 18:09 -0700
                  Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-12 10:17 -0700
                    Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-12 20:58 +0100
                      Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-12 19:59 -0700
                        Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-13 13:47 +0200
                          Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-13 05:35 -0700
                            Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-13 15:59 +0200
                              Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-13 07:57 -0700
                                Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-13 17:46 +0200
                                  Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-13 09:15 -0700
                                    Re: C pointer semantics with dynamically allocated struct Richard Heathfield <rjh@cpax.org.uk> - 2015-08-13 17:21 +0100
                                      Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-13 09:26 -0700
                                        Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-13 19:40 +0100
                                          Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-13 11:43 -0700
                                            Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-13 21:30 +0100
                                              Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-13 14:56 -0700
                                      Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-14 08:51 +0200
                                        Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-14 00:03 -0700
                              Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-13 17:22 +0100
                                Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-14 09:09 +0200
                                  Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-14 11:19 +0100
                                    Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-14 13:07 +0200
                                      Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-14 19:19 +0100
                                        Re: C pointer semantics with dynamically allocated struct James Kuyper <jameskuyper@verizon.net> - 2015-08-14 14:32 -0400
                                          Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-16 16:52 +0200
                                            Re: C pointer semantics with dynamically allocated struct Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-08-16 18:34 +0000
                                              Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-17 07:48 +0200
                                                Re: C pointer semantics with dynamically allocated struct Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-08-18 18:08 +0000
                                                  Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-19 09:36 +0200
                                            Re: C pointer semantics with dynamically allocated struct David Thompson <dave.thompson2@verizon.net> - 2015-08-30 03:03 -0400
                                              Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-30 16:59 +0200
                                              Re: C pointer semantics with dynamically allocated struct glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-30 20:12 +0000
                                            Re: C pointer semantics with dynamically allocated struct Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-05 14:36 -0700
                                        Re: C pointer semantics with dynamically allocated struct Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-05 12:39 -0700
                                    Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-14 07:56 -0700
                                      Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-14 17:09 +0100
                                        Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-14 11:38 -0700
                                          Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-14 20:31 +0100
                                  Re: C pointer semantics with dynamically allocated struct Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-05 15:17 -0700
                                    Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-09-06 11:44 +0200
                            Re: C pointer semantics with dynamically allocated struct Richard Damon <Richard@Damon-Family.org> - 2015-08-14 20:56 -0400
                              Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-14 18:09 -0700
                                Re: C pointer semantics with dynamically allocated struct Richard Damon <Richard@Damon-Family.org> - 2015-08-14 22:26 -0400
                                  Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-14 19:44 -0700
                                    Re: C pointer semantics with dynamically allocated struct glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-15 04:15 +0000
                                      Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-16 19:00 +0200
                                        Re: C pointer semantics with dynamically allocated struct Bartc <bc@freeuk.com> - 2015-08-16 19:00 +0100
                                          Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-16 20:20 +0200
                                            Re: C pointer semantics with dynamically allocated struct Keith Thompson <kst-u@mib.org> - 2015-08-16 17:18 -0700
                                          Re: C pointer semantics with dynamically allocated struct Bartc <bc@freeuk.com> - 2015-08-16 23:03 +0100
                                            Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 00:52 +0200
                                              Re: C pointer semantics with dynamically allocated struct Bartc <bc@freeuk.com> - 2015-08-17 00:29 +0100
                                                A simpler version of C (was: Re: C pointer semantics with dynamically allocated struct) "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 02:36 +0200
                                          Re: C pointer semantics with dynamically allocated struct glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-17 01:47 +0000
                                            Re: C pointer semantics with dynamically allocated struct Bartc <bc@freeuk.com> - 2015-08-17 11:27 +0100
                                              Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 12:40 +0200
                                                Re: C pointer semantics with dynamically allocated struct Bartc <bc@freeuk.com> - 2015-08-17 12:07 +0100
                                                  Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 13:36 +0200
                                                    Re: C pointer semantics with dynamically allocated struct Bartc <bc@freeuk.com> - 2015-08-17 13:14 +0100
                                                  Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 14:09 +0200
                                                    Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-17 05:23 -0700
                                                      Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 14:35 +0200
                                                        Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-17 05:45 -0700
                                                          Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 14:58 +0200
                                                            Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-17 06:23 -0700
                                                              Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 15:30 +0200
                                                                Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-17 06:46 -0700
                                                                  Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 15:47 +0200
                                                                    Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-17 06:56 -0700
                                                                      Re: C pointer semantics with dynamically allocated struct fir <profesor.fir@gmail.com> - 2015-08-17 08:57 -0700
                                                                    Re: C pointer semantics with dynamically allocated struct Richard Heathfield <rjh@cpax.org.uk> - 2015-08-17 15:37 +0100
                                                        Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-17 15:03 +0200
                                                          Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 15:12 +0200
                                                            Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-17 16:15 +0200
                                                              Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 16:45 +0200
                                                                Re: C pointer semantics with dynamically allocated struct Bartc <bc@freeuk.com> - 2015-08-17 15:58 +0100
                                                                  Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 22:11 +0200
                                                                    Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-17 22:24 +0200
                                                                      Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 22:31 +0200
                                                                        Re: C pointer semantics with dynamically allocated struct Keith Thompson <kst-u@mib.org> - 2015-08-17 15:04 -0700
                                                                          Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 23:41 +0200
                                                                            Re: C pointer semantics with dynamically allocated struct Keith Thompson <kst-u@mib.org> - 2015-08-17 17:58 -0700
                                                                          Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-17 14:53 -0700
                                                                Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-17 16:58 +0200
                                                                  Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 22:16 +0200
                                                                    Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-18 01:31 +0200
                                                                      Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-19 08:51 +0200
                                                                        Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-19 09:56 +0200
                                                                          Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-20 08:52 +0200
                                                                            Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-20 10:09 +0200
                                                                              Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-20 12:48 +0200
                                                                                Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-20 13:00 +0200
                                                                                Re: C pointer semantics with dynamically allocated struct Ike Naar <ike@iceland.freeshell.org> - 2015-08-20 13:53 +0000
                                                                                  Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-20 16:36 +0200
                                                                                    Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-20 07:39 -0700
                                                                                Re: C pointer semantics with dynamically allocated struct Keith Thompson <kst-u@mib.org> - 2015-08-20 09:09 -0700
                                                                                  Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-20 09:08 -0700
                                                                                    Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-21 10:15 +0200
                                                                                      Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-21 02:17 -0700
                                                                                        Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-21 14:23 +0100
                                                                                          Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-21 15:44 +0200
                                                                                            Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-21 14:59 +0100
                                                                                              Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-21 07:03 -0700
                                                                                              Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-23 21:50 +0200
                                                                                            Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-21 16:25 +0200
                                                                                              Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-21 07:34 -0700
                                                                                        Re: C pointer semantics with dynamically allocated struct Bartc <bc@freeuk.com> - 2015-08-21 20:44 +0100
                                                                                          Re: C pointer semantics with dynamically allocated struct raltbos@xs4all.nl (Richard Bos) - 2015-08-22 14:10 +0000
                                                          Re: C pointer semantics with dynamically allocated struct glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-17 20:08 +0000
                                                        Re: C pointer semantics with dynamically allocated struct Keith Thompson <kst-u@mib.org> - 2015-08-17 09:33 -0700
                                                          Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-17 22:20 +0200
                                                            Re: C pointer semantics with dynamically allocated struct James Kuyper <jameskuyper@verizon.net> - 2015-08-17 17:28 -0400
                                                              Re: C pointer semantics with dynamically allocated struct Keith Thompson <kst-u@mib.org> - 2015-08-17 16:42 -0700
                                                                Re: C pointer semantics with dynamically allocated struct James Kuyper <jameskuyper@verizon.net> - 2015-08-17 19:39 -0400
                                                            Re: C pointer semantics with dynamically allocated struct Keith Thompson <kst-u@mib.org> - 2015-08-17 16:15 -0700
                                                            Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-18 00:19 +0100
                                                  Re: C pointer semantics with dynamically allocated struct Richard Damon <Richard@Damon-Family.org> - 2015-08-17 08:32 -0400
                                                    Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-17 18:02 +0100
                                                  Re: C pointer semantics with dynamically allocated struct Rosario19 <Ros@invalid.invalid> - 2015-08-22 08:25 +0200
                                                Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-17 14:46 +0200
                                              Re: C pointer semantics with dynamically allocated struct Keith Thompson <kst-u@mib.org> - 2015-08-17 09:45 -0700
                                                Re: C pointer semantics with dynamically allocated struct Bartc <bc@freeuk.com> - 2015-08-17 18:55 +0100
                                                  Re: C pointer semantics with dynamically allocated struct Keith Thompson <kst-u@mib.org> - 2015-08-17 12:11 -0700
                                                    Re: C pointer semantics with dynamically allocated struct Bartc <bc@freeuk.com> - 2015-08-17 23:07 +0100
                                                      Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-17 15:13 -0700
                                                      Re: C pointer semantics with dynamically allocated struct glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-17 22:56 +0000
                                              Re: C pointer semantics with dynamically allocated struct glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-17 20:04 +0000
                        Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-13 14:46 +0100
                          Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-13 07:33 -0700
                            Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-13 16:39 +0200
                            Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-13 19:20 +0100
                              Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-13 11:55 -0700
                                Re: C pointer semantics with dynamically allocated struct Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-13 21:11 +0100
                                  Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-13 15:15 -0700
                                  Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-14 09:29 +0200
                                    Re: C pointer semantics with dynamically allocated struct James Kuyper <jameskuyper@verizon.net> - 2015-08-14 08:01 -0400
                                      Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-14 14:46 +0200
                                        Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-16 19:14 +0200
                                          Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-17 08:01 +0200
                    Re: C pointer semantics with dynamically allocated struct Richard Damon <Richard@Damon-Family.org> - 2015-08-12 23:30 -0400
                      Re: C pointer semantics with dynamically allocated struct Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-05 12:45 -0700
                        Re: C pointer semantics with dynamically allocated struct Keith Thompson <kst-u@mib.org> - 2015-09-05 16:11 -0700
                        Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-09-05 22:32 -0700
                          Re: C pointer semantics with dynamically allocated struct Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-06 13:21 -0700
                Re: C pointer semantics with dynamically allocated struct David Brown <david.brown@hesbynett.no> - 2015-08-12 09:22 +0200
              Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-11 19:43 -0700
          Re: C pointer semantics with dynamically allocated struct "Morten W. Petersen" <morphex@gmail.com> - 2015-08-11 22:52 +0200
            Re: C pointer semantics with dynamically allocated struct "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-11 16:01 -0700
    Re: C pointer semantics with dynamically allocated struct Rosario19 <Ros@invalid.invalid> - 2015-08-12 11:13 +0200

Page 1 of 12  [1] 2 3 … 12  Next page →


#67120 — C pointer semantics with dynamically allocated struct

From"Morten W. Petersen" <morphex@gmail.com>
Date2015-08-11 20:48 +0200
SubjectC pointer semantics with dynamically allocated struct
Message-ID<mqdg0t$rv2$1@speranza.aioe.org>
Hi there.

I'm working on a project that dynamically allocates different structs
into memory, they all share a basic set of variables.

When compiling the project I get an error on the following line:

https://github.com/morphex/smash_xml/blob/9fd7cc902c1a19c9e0f383da9ceda18b15fd1f09/decode_xml.c#L948

It says "error: request for member `parent' in something not a
struct or union".

What am I doing wrong here?

Regards,

Morten

[toc] | [next] | [standalone]


#67122

FromMelzzzzz <mel@zzzzz.com>
Date2015-08-11 20:59 +0200
Message-ID<20150811205902.55809c07@maxa-pc>
In reply to#67120
On Tue, 11 Aug 2015 20:48:02 +0200
"Morten W. Petersen" <morphex@gmail.com> wrote:

> Hi there.
> 
> I'm working on a project that dynamically allocates different structs
> into memory, they all share a basic set of variables.
> 
> When compiling the project I get an error on the following line:
> 
> https://github.com/morphex/smash_xml/blob/9fd7cc902c1a19c9e0f383da9ceda18b15fd1f09/decode_xml.c#L948
> 
> It says "error: request for member `parent' in something not a
> struct or union".
> 
> What am I doing wrong here?

You don't cast previous,  but parent...

[toc] | [prev] | [next] | [standalone]


#67123

FromMelzzzzz <mel@zzzzz.com>
Date2015-08-11 21:03 +0200
Message-ID<20150811210323.64aa5af9@maxa-pc>
In reply to#67120
On 11 Aug 2015 18:57:44 GMT
ram@zedat.fu-berlin.de (Stefan Ram) wrote:

> "Morten W. Petersen" <morphex@gmail.com> writes:
> >When compiling the project I get an error on the following line:
> >https://github.com/morphex/smash_xml/blob/9fd7cc902c1a19c9e0...
> 
>   This is a label followed by a comment and compiles fine here:
> 
> #include <stdio.h>
> int main( void )
> { printf( "hello, " );
>   https://example.com/example/12345
>   printf( "world" ); }
> 
>   . Prints:
> 
> hello, world
> 
>   .
> 

gcc -std=c90 -Wall wontcompile.c
wontcompile.c: In function ‘main’:
wontcompile.c:4:9: error: C++ style comments are not allowed in ISO C90
   https://example.com/example/12345
         ^
wontcompile.c:4:9: error: (this will be reported only once per input file)
wontcompile.c:4:3: warning: label ‘https’ defined but not used [-Wunused-label]
   https://example.com/example/12345
   ^
wontcompile.c:5:3: warning: control reaches end of non-void function [-Wreturn-type]
   printf( "world" ); }

[toc] | [prev] | [next] | [standalone]


#67127

FromJames Kuyper <jameskuyper@verizon.net>
Date2015-08-11 15:32 -0400
Message-ID<mqdiha$k9a$1@dont-email.me>
In reply to#67123
On 08/11/2015 03:03 PM, Melzzzzz wrote:
> On 11 Aug 2015 18:57:44 GMT
> ram@zedat.fu-berlin.de (Stefan Ram) wrote:
> 
>> "Morten W. Petersen" <morphex@gmail.com> writes:
>>> When compiling the project I get an error on the following line:
>>> https://github.com/morphex/smash_xml/blob/9fd7cc902c1a19c9e0...
>>
>>   This is a label followed by a comment and compiles fine here:
>>
>> #include <stdio.h>
>> int main( void )
>> { printf( "hello, " );
>>   https://example.com/example/12345
>>   printf( "world" ); }
>>
>>   . Prints:
>>
>> hello, world
>>
>>   .
>>
> 
> gcc -std=c90 -Wall wontcompile.c

His joke is obviously targeted at C99 or later.
-- 
James Kuyper

[toc] | [prev] | [next] | [standalone]


#67124

Fromjacobnavia <jacob@jacob.remcomp.fr>
Date2015-08-11 21:03 +0200
Message-ID<mqdgr9$cp4$1@dont-email.me>
In reply to#67120
Le 11/08/2015 20:48, Morten W. Petersen a écrit :
> What am I doing wrong here?

You have declared "previous" as a void *, then you try to use it as a 
structure...

Not good, not good :-)

FIX:

1) Send me my consulting fees
2) Change the declaration

jacob

[toc] | [prev] | [next] | [standalone]


#67128

From"Morten W. Petersen" <morphex@gmail.com>
Date2015-08-11 21:47 +0200
Message-ID<mqdjgn$4b8$1@speranza.aioe.org>
In reply to#67124
On 11.08.2015 21:03, jacobnavia wrote:
> Le 11/08/2015 20:48, Morten W. Petersen a écrit :
>> What am I doing wrong here?
>
> You have declared "previous" as a void *, then you try to use it as a
> structure...
>
> Not good, not good :-)
>
> FIX:
>
> 1) Send me my consulting fees
> 2) Change the declaration

3) Watch Jacob laugh all the way to the bank.

Heh, heh.

-Morten

[toc] | [prev] | [next] | [standalone]


#67125

Fromjt@toerring.de (Jens Thoms Toerring)
Date2015-08-11 19:14 +0000
Message-ID<d2uvs2F4b52U1@mid.uni-berlin.de>
In reply to#67120
Morten W. Petersen <morphex@gmail.com> wrote:
> Hi there.

> I'm working on a project that dynamically allocates different structs
> into memory, they all share a basic set of variables.

> When compiling the project I get an error on the following line:

> https://github.com/morphex/smash_xml/blob/9fd7cc902c1a19c9e0f383da9ceda18b15fd1f09/decode_xml.c#L948

> It says "error: request for member `parent' in something not a
> struct or union".

> What am I doing wrong here?

That line seems to be:

  new->parent = (struct xml_element*) previous->parent;

and somewhere before you have

  void *previous = NULL;

So previous is a void pointer and thus isn't a struct pointer.
I guess you acually intended to write

  new->parent = ((struct xml_element*) previous)->parent;

since the '->' operator binds more tightly than a cast
and you were casting not 'previous' but the result of
'previous->parent' (but, if you get it, already had
that type).

The following line

  (struct xml_element* ) previous->next = new;

shows the same problem, though.

A better solution instead of using all those ugly casts
probably would be to define 'previous' as a 'struct
xml_element' pointer - it doesn't seem to be used for
anything else anyway. And avoiding casts is INHO always
a good thing.
                        Regards, Jens
-- 
  \   Jens Thoms Toerring  ___      jt@toerring.de
   \__________________________      http://toerring.de

[toc] | [prev] | [next] | [standalone]


#67129

From"Morten W. Petersen" <morphex@gmail.com>
Date2015-08-11 21:50 +0200
Message-ID<mqdjm2$4b8$2@speranza.aioe.org>
In reply to#67125
On 11.08.2015 21:14, Jens Thoms Toerring wrote:
[...]
> So previous is a void pointer and thus isn't a struct pointer.
> I guess you acually intended to write
>
>    new->parent = ((struct xml_element*) previous)->parent;
>
> since the '->' operator binds more tightly than a cast
> and you were casting not 'previous' but the result of
> 'previous->parent' (but, if you get it, already had
> that type).
>
> The following line
>
>    (struct xml_element* ) previous->next = new;
>
> shows the same problem, though.
>
> A better solution instead of using all those ugly casts
> probably would be to define 'previous' as a 'struct
> xml_element' pointer - it doesn't seem to be used for
> anything else anyway. And avoiding casts is INHO always
> a good thing.

Ah yes you were right about the casting and precedence, that's
what I was looking for.. As for making a stricter definition,
I haven't quite sorted out how the thing should work yet
and don't want to use variables that are unnecessary.

-Morten

[toc] | [prev] | [next] | [standalone]


#67131

FromJames Kuyper <jameskuyper@verizon.net>
Date2015-08-11 16:12 -0400
Message-ID<mqdkt8$u41$1@dont-email.me>
In reply to#67129
On 08/11/2015 03:50 PM, Morten W. Petersen wrote:
> On 11.08.2015 21:14, Jens Thoms Toerring wrote:
> [...]
>> So previous is a void pointer and thus isn't a struct pointer.
>> I guess you acually intended to write
>>
>>    new->parent = ((struct xml_element*) previous)->parent;
>>
>> since the '->' operator binds more tightly than a cast
>> and you were casting not 'previous' but the result of
>> 'previous->parent' (but, if you get it, already had
>> that type).
>>
>> The following line
>>
>>    (struct xml_element* ) previous->next = new;
>>
>> shows the same problem, though.
>>
>> A better solution instead of using all those ugly casts
>> probably would be to define 'previous' as a 'struct
>> xml_element' pointer - it doesn't seem to be used for
>> anything else anyway. And avoiding casts is INHO always
>> a good thing.
> 
> Ah yes you were right about the casting and precedence, that's
> what I was looking for.. As for making a stricter definition,
> I haven't quite sorted out how the thing should work yet
> and don't want to use variables that are unnecessary.

That's reasonable in itself, but nowhere near as important as avoiding
using unnecessary casts. Give previous a more appropriate definition,
and the casts are no longer necessary.


-- 
James Kuyper

[toc] | [prev] | [next] | [standalone]


#67134

From"Morten W. Petersen" <morphex@gmail.com>
Date2015-08-11 22:45 +0200
Message-ID<mqdmso$c11$1@speranza.aioe.org>
In reply to#67131
On 11.08.2015 22:12, James Kuyper wrote:
> On 08/11/2015 03:50 PM, Morten W. Petersen wrote:
>> On 11.08.2015 21:14, Jens Thoms Toerring wrote:
>> [...]
>>> So previous is a void pointer and thus isn't a struct pointer.
>>> I guess you acually intended to write
>>>
>>>     new->parent = ((struct xml_element*) previous)->parent;
>>>
>>> since the '->' operator binds more tightly than a cast
>>> and you were casting not 'previous' but the result of
>>> 'previous->parent' (but, if you get it, already had
>>> that type).
>>>
>>> The following line
>>>
>>>     (struct xml_element* ) previous->next = new;
>>>
>>> shows the same problem, though.
>>>
>>> A better solution instead of using all those ugly casts
>>> probably would be to define 'previous' as a 'struct
>>> xml_element' pointer - it doesn't seem to be used for
>>> anything else anyway. And avoiding casts is INHO always
>>> a good thing.
>>
>> Ah yes you were right about the casting and precedence, that's
>> what I was looking for.. As for making a stricter definition,
>> I haven't quite sorted out how the thing should work yet
>> and don't want to use variables that are unnecessary.
>
> That's reasonable in itself, but nowhere near as important as avoiding
> using unnecessary casts. Give previous a more appropriate definition,
> and the casts are no longer necessary.

Well, if you take a look at the code, the struct definitions have all
got the same header.  So when working with a parsed internal
representation of the data, casting will be done based on the first
entry in the given struct, the type.

As for the parsing loop, I haven't quite figured out how it should
work yet, so instead of being specific, I'm going to try to be
generic until the point where it doesn't pay off.

void *previous is defined on line 914, and the following loop could
encounter for example character data which will be represented by
xml_text, and xml_text can have a next pointer and could because of
that be a struct that previous points to.

-Morten

[toc] | [prev] | [next] | [standalone]


#67156

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2015-08-12 03:08 +0100
Message-ID<87io8l9s1x.fsf@bsb.me.uk>
In reply to#67134
"Morten W. Petersen" <morphex@gmail.com> writes:
<snip>
> Well, if you take a look at the code, the struct definitions have all
> got the same header.  So when working with a parsed internal
> representation of the data, casting will be done based on the first
> entry in the given struct, the type.

I'd say that using void * and casting is not the right way to go about
this.  I'd put the common elements into a struct and put that struct
first in all other others.  Most of the time you can use exactly the
right type

  xml_complex_type *p = malloc(sizeof *p);
  p->common->parent = ...;

and sometimes you can use a pointer to the common part as a generic
pointer because generic operations usually use only the common parts.
Every now and then you need to convert between a pointer to the common
part to a pointer to one of the more complex structures and the cast
will alert you and others to the fact that this is an insecure
operation.

(If you use a "discriminated union" you can check this conversion at run
time, but that's a separate matter.)

<snip>
-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#67126

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2015-08-11 20:24 +0100
Message-ID<87tws5aash.fsf@bsb.me.uk>
In reply to#67120
"Morten W. Petersen" <morphex@gmail.com> writes:

> I'm working on a project that dynamically allocates different structs
> into memory, they all share a basic set of variables.
>
> When compiling the project I get an error on the following line:
>
> https://github.com/morphex/smash_xml/blob/9fd7cc902c1a19c9e0f383da9ceda18b15fd1f09/decode_xml.c#L948
>
> It says "error: request for member `parent' in something not a
> struct or union".
>
> What am I doing wrong here?

The line is:

  new->parent = (struct xml_element*) previous->parent;

and the declaration of previous shows that it's a void * -- i.e. it
points to something that is not (or at least not known to be) a struct.
You might have meant

  new->parent = ((struct xml_element*) previous)->parent;

but then why is parent not a pointer to an xml_element already?  A cast
should indicate something odd going on and setting one element's parent
pointer form that of another does not seem to me to be an odd thing to
do.

BTW, it seems a shame to make the code system specific with the use of
fileno and fstat but if you decide to keep that code, you should probably
put it off to one side in a system-specific helper function.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#67130

From"Morten W. Petersen" <morphex@gmail.com>
Date2015-08-11 21:51 +0200
Message-ID<mqdjo9$4b8$3@speranza.aioe.org>
In reply to#67126
On 11.08.2015 21:24, Ben Bacarisse wrote:
[...]
> BTW, it seems a shame to make the code system specific with the use of
> fileno and fstat but if you decide to keep that code, you should probably
> put it off to one side in a system-specific helper function.

Ah yes, the idea is to make it platform-independent, guess I just found
an example and didn't think it through.

It should compile and run on every major platform.

-Morten

[toc] | [prev] | [next] | [standalone]


#67132

From"Rick C. Hodgin" <rick.c.hodgin@gmail.com>
Date2015-08-11 13:32 -0700
Message-ID<353134d7-880d-44a5-81d9-1a317d3d2fd0@googlegroups.com>
In reply to#67130
On Tuesday, August 11, 2015 at 3:51:48 PM UTC-4, Morten W. Petersen wrote:
> On 11.08.2015 21:24, Ben Bacarisse wrote:
> [...]
> > BTW, it seems a shame to make the code system specific with the use of
> > fileno and fstat but if you decide to keep that code, you should probably
> > put it off to one side in a system-specific helper function.
> 
> Ah yes, the idea is to make it platform-independent, guess I just found
> an example and didn't think it through.
> 
> It should compile and run on every major platform.
> 
> -Morten

Another idea assuming your compiler supports anonymous unions:

    struct SWhatever {
        void* previous;
        union {
            struct xml_element*  prev_xml_element;
            struct xml_whatever* prev_xml_whatever;
        };
    };

And then in your code below, rather than referencing previous member,
reference the appropriate-by-context member directly:

    new->parent = prev_xml_element->parent;

Best regards,
Rick C. Hodgin

[toc] | [prev] | [next] | [standalone]


#67133

From"Rick C. Hodgin" <rick.c.hodgin@gmail.com>
Date2015-08-11 13:36 -0700
Message-ID<56764795-b877-4b9b-bb88-8d04715d95da@googlegroups.com>
In reply to#67132
On Tuesday, August 11, 2015 at 4:32:29 PM UTC-4, Rick C. Hodgin wrote:
>     struct SWhatever {
>         union {
>             void* previous;
>             struct xml_element*  prev_xml_element;
>             struct xml_whatever* prev_xml_whatever;
>         };
>     };

Before I get pounced on by snipers, it should be as above.

Best regards,
Rick C. Hodgin

[toc] | [prev] | [next] | [standalone]


#67136

FromDavid Brown <david.brown@hesbynett.no>
Date2015-08-11 22:57 +0200
Message-ID<mqdngg$9he$1@dont-email.me>
In reply to#67133
On 11/08/15 22:36, Rick C. Hodgin wrote:
> On Tuesday, August 11, 2015 at 4:32:29 PM UTC-4, Rick C. Hodgin wrote:
>>     struct SWhatever {
>>         union {
>>             void* previous;
>>             struct xml_element*  prev_xml_element;
>>             struct xml_whatever* prev_xml_whatever;
>>         };
>>     };
> 
> Before I get pounced on by snipers, it should be as above.
> 

Can I pounce on you a bit, to suggest that you don't edit quotations
(even to correct a quotation from your own post)?  Just put the
corrected code as a normal post - Usenet standard is for quoted parts to
be exact quotations.


Other than that, unions such as you use here are often a better solution
than casting - they can avoid complications due to strict aliasing
optimisations, as well as keeping the type changes more limited.  (By
that I mean that a union such as the one here gives you a choice of
three different pointer types, while a cast lets you pick /any/ type.
Limiting the options reduces the risk of errors.)

[toc] | [prev] | [next] | [standalone]


#67137

From"Morten W. Petersen" <morphex@gmail.com>
Date2015-08-11 23:23 +0200
Message-ID<mqdp4m$hcj$1@speranza.aioe.org>
In reply to#67136
On 11.08.2015 22:57, David Brown wrote:
[...]
> Other than that, unions such as you use here are often a better solution
> than casting - they can avoid complications due to strict aliasing
> optimisations, as well as keeping the type changes more limited.  (By
> that I mean that a union such as the one here gives you a choice of
> three different pointer types, while a cast lets you pick /any/ type.
> Limiting the options reduces the risk of errors.)

Aha, I see.  Yes that could be a useful feature to have, but I'm
not sure I want that level of strictness.

However, I don't expect XML to change much, same for the internal
representation of the XML, and I don't see other developers developing
a snide xml_* struct that has to work.. So maybe it's just good to be
strict and allow the compiler to give a good, simple explanation when
something is wrong.

-Morten

[toc] | [prev] | [next] | [standalone]


#67140

FromKeith Thompson <kst-u@mib.org>
Date2015-08-11 16:47 -0700
Message-ID<lnk2t1crqq.fsf@kst-u.example.com>
In reply to#67136
David Brown <david.brown@hesbynett.no> writes:
[...]
> Can I pounce on you a bit, to suggest that you don't edit
> quotations (even to correct a quotation from your own post)?
> Just put the corrected code as a normal post - Usenet standard
> is for quoted parts to be exact quotations.

I sometimes reformat quoted text (not code), particularly if
the original text has very long lines, changing *only* spacing
and line breaks.  I've done so with the quoted paragraph above.
I usually don't bother to mention it.

I don't do this for code samples.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

[toc] | [prev] | [next] | [standalone]


#67141

Fromglen herrmannsfeldt <gah@ugcs.caltech.edu>
Date2015-08-11 23:46 +0000
Message-ID<mqe1gs$37a$1@speranza.aioe.org>
In reply to#67140
Keith Thompson <kst-u@mib.org> wrote:

(snip on quoting rules for usenet)

> I sometimes reformat quoted text (not code), particularly if
> the original text has very long lines, changing *only* spacing
> and line breaks.  I've done so with the quoted paragraph above.
> I usually don't bother to mention it.

My news host requires posts to mostly fit in 80 columns.
(Usually it will allow a small number of long lines, 
especially URLs.)  So I often have to reformat line breaks.
 
> I don't do this for code samples.

I sometimes remove blank lines from code samples, and maybe reformat
if lines are longer than 80 columns. 

I might only quote part of a code sample, that is, remove lines
before and after the part of interest, especially if it is long.

I didn't know that there was an actual rule before, though.

-- glen

[toc] | [prev] | [next] | [standalone]


#67143

Frommorphex@gmail.com (Morten W. Petersen)
Date2015-08-12 02:05 +0200
Message-ID<vrivegj9fk1a.fsf@gmail.com>
In reply to#67141
glen herrmannsfeldt <gah@ugcs.caltech.edu> writes:

> I sometimes remove blank lines from code samples, and maybe reformat
> if lines are longer than 80 columns. 
>
> I might only quote part of a code sample, that is, remove lines
> before and after the part of interest, especially if it is long.
>
> I didn't know that there was an actual rule before, though.

Well just for fun I fired up Gnus in Emacs, and it seems to be working
quite well.  Not doing any manual line wrapping now and looks like
Gnus/Emacs does the right thing.

-Morten

[toc] | [prev] | [next] | [standalone]


Page 1 of 12  [1] 2 3 … 12  Next page →

Back to top | Article view | comp.lang.c


csiph-web