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


Groups > comp.lang.c++ > #89160 > unrolled thread

Is this safe?

Started byMuttley@dastardlyhq.com
First post2023-02-20 16:45 +0000
Last post2023-02-21 08:15 -0800
Articles 20 on this page of 203 — 22 participants

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


Contents

  Is this safe? Muttley@dastardlyhq.com - 2023-02-20 16:45 +0000
    Re: Is this safe? Bonita Montero <Bonita.Montero@gmail.com> - 2023-02-20 18:34 +0100
      Re: Is this safe? Chris Vine <vine24683579@gmail.com> - 2023-02-20 11:16 -0800
        Re: Is this safe? Bonita Montero <Bonita.Montero@gmail.com> - 2023-02-20 21:39 +0100
          Re: Is this safe? Chris Vine <vine24683579@gmail.com> - 2023-02-20 12:56 -0800
            Re: Is this safe? Tony Oliver <guinness.tony@gmail.com> - 2023-02-20 16:17 -0800
              Re: Is this safe? Manu Raju <MR@invalid.invalid> - 2023-02-21 01:57 +0000
                Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-21 09:15 +0000
                  Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-21 12:31 +0200
            Re: Is this safe? Bonita Montero <Bonita.Montero@gmail.com> - 2023-02-21 05:36 +0100
              Re: Is this safe? Chris Vine <vine24683579@gmail.com> - 2023-02-21 02:19 -0800
                Re: Is this safe? Bonita Montero <Bonita.Montero@gmail.com> - 2023-02-21 14:16 +0100
                  Re: Is this safe? Ralf Goertz <me@myprovider.invalid> - 2023-02-21 14:40 +0100
                  Re: Is this safe? Chris Vine <vine24683579@gmail.com> - 2023-02-21 05:51 -0800
                  Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-21 15:58 +0200
                    Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-21 14:55 +0000
                      Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-21 19:02 +0200
                        Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-21 17:13 +0000
                          Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-21 19:58 +0200
                            Re: Is this safe? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-02-21 12:15 -0800
                              Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-21 23:41 +0200
                                Re: Is this safe? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-03-03 12:57 -0800
        Re: Is this safe? Tony Oliver <guinness.tony@gmail.com> - 2023-02-20 16:14 -0800
          Re: Is this safe? James Kuyper <jameskuyper@alumni.caltech.edu> - 2023-02-20 23:48 -0500
        Re: Is this safe? Öö Tiib <ootiib@hot.ee> - 2023-02-21 00:05 -0800
      Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-21 09:14 +0000
    Re: Is this safe? Richard Damon <Richard@Damon-Family.org> - 2023-02-20 21:18 -0500
    Re: Is this safe? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2023-02-20 20:38 -0800
      Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-21 09:18 +0000
        Re: Is this safe? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2023-02-21 15:12 +0100
          Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-21 14:53 +0000
            Re: Is this safe? "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2023-02-21 10:35 -0800
              Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-22 09:25 +0000
                Re: Is this safe? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2023-02-22 22:33 +0100
                  Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-23 09:25 +0000
                    Re: Is this safe? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2023-02-23 07:05 -0800
                Re: Is this safe? "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2023-02-22 21:21 -0800
                Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-23 09:39 +0200
                  Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-23 09:35 +0000
                    Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-23 12:30 +0200
                      Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-23 10:34 +0000
                        Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-23 13:20 +0200
                          Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-23 16:00 +0000
                            Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-23 18:24 +0200
                              Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-23 16:28 +0000
                                Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-23 19:01 +0200
                              Re: Is this safe? James Kuyper <jameskuyper@alumni.caltech.edu> - 2023-02-23 11:57 -0500
                                Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-23 19:12 +0200
                          Re: Is this safe? James Kuyper <jameskuyper@alumni.caltech.edu> - 2023-02-23 11:57 -0500
                            Re: Is this safe? Richard Damon <Richard@Damon-Family.org> - 2023-02-23 12:20 -0500
                              Re: Is this safe? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-02-24 02:15 +0000
                                Re: Is this safe? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-02-24 15:24 -0800
                              Re: Is this safe? James Kuyper <jameskuyper@alumni.caltech.edu> - 2023-02-24 02:14 -0500
                        Re: Is this safe? Richard Damon <Richard@Damon-Family.org> - 2023-02-23 07:18 -0500
                          Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-23 16:01 +0000
                            Re: Is this safe? Richard Damon <Richard@Damon-Family.org> - 2023-02-23 11:50 -0500
                              Re: Is this safe? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-02-23 14:41 -0800
                            Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-23 19:44 +0100
                        Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-23 15:02 +0100
                          Re: Is this safe? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-02-23 14:49 +0000
                            Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-23 16:25 +0100
                          Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-23 16:10 +0000
                            Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-23 20:46 +0100
                              Re: Is this safe? scott@slp53.sl.home (Scott Lurndal) - 2023-02-23 20:05 +0000
                                Re: Is this safe? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-02-23 14:48 -0800
                                  Re: Is this safe? Richard Damon <Richard@Damon-Family.org> - 2023-02-23 22:12 -0500
                                  Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-24 10:49 +0200
                                Re: Is this safe? Ralf Fassel <ralfixx@gmx.de> - 2023-02-24 11:36 +0100
                                  Re: Is this safe? scott@slp53.sl.home (Scott Lurndal) - 2023-02-24 15:39 +0000
                              Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-24 10:29 +0000
                                Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-24 17:20 +0100
                                  Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-24 17:09 +0000
                                    Re: Is this safe? scott@slp53.sl.home (Scott Lurndal) - 2023-02-24 17:32 +0000
                                      Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-25 11:56 +0000
                                        Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-25 16:04 +0100
                                          Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-25 15:47 +0000
                                            Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-25 19:13 +0100
                                              Re: Is this safe? scott@slp53.sl.home (Scott Lurndal) - 2023-02-25 19:00 +0000
                                              Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-27 08:43 +0000
                                                Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-27 10:31 +0100
                                          Re: Is this safe? scott@slp53.sl.home (Scott Lurndal) - 2023-02-25 16:40 +0000
                                    Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-24 18:42 +0100
                                      Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-25 11:58 +0000
                                        Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-25 16:25 +0100
                                          Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-25 15:45 +0000
                                            Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-25 19:15 +0100
                                              Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-27 08:44 +0000
                                                Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-27 10:40 +0100
                                                  Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-27 10:24 +0000
                                                    Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-27 18:31 +0100
                                                      Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-28 08:38 +0000
                                                        Re: Is this safe? Öö Tiib <ootiib@hot.ee> - 2023-02-28 01:33 -0800
                                                          Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-28 10:17 +0000
                                                            Re: Is this safe? Öö Tiib <ootiib@hot.ee> - 2023-02-28 02:43 -0800
                                                              Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-28 16:50 +0100
                                                        Re: Is this safe? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-02-28 03:19 -0800
                                                          Re: Is this safe? Richard Damon <Richard@Damon-Family.org> - 2023-02-28 08:10 -0500
                                                            Re: Is this safe? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-02-28 05:42 -0800
                                                              Re: Is this safe? Richard Damon <Richard@Damon-Family.org> - 2023-02-28 09:39 -0500
                                                                Re: Is this safe? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-02-28 07:12 -0800
                                                                  Re: Is this safe? Richard Damon <Richard@Damon-Family.org> - 2023-02-28 11:29 -0500
                                                              Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-28 16:45 +0100
                                                                Re: Is this safe? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-02-28 11:31 -0800
                                                                  Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-28 20:59 +0100
                                                              Re: Is this safe? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-03-01 14:29 -0800
                                                        Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-28 16:37 +0100
                                                          Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-28 15:56 +0000
                                                            Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-28 18:34 +0100
                                                              Re: Is this safe? Muttley@dastardlyhq.com - 2023-03-01 09:37 +0000
                                                                Re: Is this safe? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-03-01 02:29 -0800
                                                                  Re: Is this safe? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-03-01 19:56 +0000
                                                                    Re: Is this safe? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-03-01 12:53 -0800
                                                                      Re: Is this safe? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-03-01 21:13 +0000
                                                                        Re: Is this safe? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-03-02 01:48 -0800
                                                                          Re: Is this safe? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-03-03 21:44 +0000
                                                                            Re: Is this safe? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-03-03 20:16 -0800
                                                                              Re: Is this safe? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-03-04 22:55 +0000
                                                                                Re: Is this safe? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-03-05 07:11 -0800
                                                                                  Re: Is this safe? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-03-05 20:44 +0000
                                                                                    Re: Is this safe? Mr Flibble <flibble2@reddwarf.jmc.corp> - 2023-03-05 21:00 +0000
                                                                                      Re: Is this safe? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-03-05 13:59 -0800
                                                                                        Re: Is this safe? Mr Flibble <flibble2@reddwarf.jmc.corp> - 2023-03-05 23:07 +0000
                                                                                      Re: Is this safe? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-03-06 00:22 +0000
                                                                                    Re: Is this safe? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-03-05 14:26 -0800
                                                                                      Re: Is this safe? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-03-06 00:51 +0000
                                                                                        Re: Is this safe? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-03-06 02:17 -0800
                                                                              Re: Is this safe? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-03-05 08:13 -0800
                                                                                Re: Is this safe? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-03-05 09:05 -0800
                                                                        Re: Is this safe? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-03-14 09:47 -0700
                                                                      Re: Is this safe? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-03-01 14:40 -0800
                                                                      Re: Is this safe? Muttley@dastardlyhq.com - 2023-03-02 09:07 +0000
                                                                  Re: Is this safe? Richard Damon <Richard@Damon-Family.org> - 2023-03-01 21:37 -0500
                                                                    Re: Is this safe? Öö Tiib <ootiib@hot.ee> - 2023-03-01 22:30 -0800
                                                                Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-03-01 14:27 +0100
                                                                  Re: Is this safe? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-03-01 10:48 -0800
                                                                    Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-03-02 10:29 +0100
                                                                Re: Is this safe? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-03-01 19:53 +0000
                                                                  Re: Is this safe? Muttley@dastardlyhq.com - 2023-03-02 09:08 +0000
                                                                    Re: Is this safe? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-03-02 01:32 -0800
                                                                      Re: Is this safe? Muttley@dastardlyhq.com - 2023-03-02 09:56 +0000
                                                                        Re: Is this safe? Öö Tiib <ootiib@hot.ee> - 2023-03-02 04:02 -0800
                                                                          Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-03-02 15:00 +0100
                                                                            Re: Is this safe? Öö Tiib <ootiib@hot.ee> - 2023-03-02 07:59 -0800
                                                                          Re: Is this safe? Muttley@dastardlyhq.com - 2023-03-02 15:38 +0000
                                                                            Re: Is this safe? "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2023-03-02 11:16 -0800
                                                                    Re: Is this safe? "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2023-03-02 11:08 -0800
                                                                      Re: Is this safe? Muttley@dastardlyhq.com - 2023-03-03 09:53 +0000
                                                                        Re: Is this safe? "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2023-03-04 06:47 -0800
                                                                    Re: Is this safe? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-03-02 19:35 +0000
                                                        Re: Is this safe? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2023-02-28 17:40 +0100
                                  Re: Is this safe? James Kuyper <jameskuyper@alumni.caltech.edu> - 2023-02-24 12:16 -0500
                                    Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-24 18:39 +0100
                                      Re: Is this safe? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-02-24 10:03 -0800
                                        Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-24 19:59 +0100
                                      Re: Is this safe? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2023-02-25 06:47 +0100
                                        Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-25 10:23 +0200
                        Re: Is this safe? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2023-02-23 07:16 -0800
                          Re: Is this safe? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-02-23 14:31 -0800
                        Re: Is this safe? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2023-02-23 16:34 +0100
                          Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-23 16:15 +0000
                            Re: Is this safe? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2023-02-24 12:17 +0100
                              Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-24 12:24 +0000
                                Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-24 15:18 +0200
                                  Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-24 15:55 +0000
                                    Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-24 18:20 +0200
                                      Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-24 17:05 +0000
                                        Re: Is this safe? Paavo Helde <eesnimi@osa.pri.ee> - 2023-02-24 19:24 +0200
                                        Re: Is this safe? "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2023-02-24 09:46 -0800
                                Re: Is this safe? David Brown <david.brown@hesbynett.no> - 2023-02-24 17:30 +0100
                        Re: Is this safe? scott@slp53.sl.home (Scott Lurndal) - 2023-02-23 17:12 +0000
                    Re: Is this safe? Öö Tiib <ootiib@hot.ee> - 2023-02-23 02:47 -0800
                      Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-23 15:59 +0000
                        Re: Is this safe? Richard Damon <Richard@Damon-Family.org> - 2023-02-23 11:55 -0500
                    Re: Is this safe? "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2023-02-23 08:37 -0800
                      Re: Is this safe? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-02-23 14:19 -0800
                  Re: Is this safe? scott@slp53.sl.home (Scott Lurndal) - 2023-02-23 17:09 +0000
                    Re: Is this safe? Richard Damon <Richard@Damon-Family.org> - 2023-02-23 12:21 -0500
                      Re: Is this safe? scott@slp53.sl.home (Scott Lurndal) - 2023-02-23 17:55 +0000
                        Re: Is this safe? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-02-23 13:57 -0800
                          Re: Is this safe? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2023-02-23 17:28 -0800
                            Re: Is this safe? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-02-23 21:44 -0800
                              Re: Is this safe? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-02-24 08:48 -0800
            Re: Is this safe? "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2023-02-21 10:58 -0800
              Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-22 09:26 +0000
                Re: Is this safe? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2023-02-22 22:34 +0100
                  Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-23 09:29 +0000
                    Re: Is this safe? "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2023-02-23 08:28 -0800
                      Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-23 17:16 +0000
                        Re: Is this safe? "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2023-02-23 22:24 -0800
                Re: Is this safe? "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2023-02-22 21:30 -0800
                  Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-23 09:31 +0000
                    Re: Is this safe? "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2023-02-23 22:00 -0800
                      Re: Is this safe? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-02-23 22:20 -0800
                        Re: Is this safe? James Kuyper <jameskuyper@alumni.caltech.edu> - 2023-02-24 01:34 -0500
                      Re: Is this safe? Muttley@dastardlyhq.com - 2023-02-24 10:32 +0000
                        Re: Is this safe? "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2023-02-25 00:19 -0800
              Re: Is this safe? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2023-02-22 08:09 -0800
          Re: Is this safe? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2023-02-21 22:32 -0800
            Re: Is this safe? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-02-22 08:32 -0800
              Re: Is this safe? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-02-22 09:17 -0800
                Re: Is this safe? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-04-04 23:28 -0700
                  Re: Is this safe? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-04-05 11:08 -0700
        Re: Is this safe? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2023-02-21 08:15 -0800

Page 6 of 11 — ← Prev page 1 … 4 5 [6] 7 8 … 11  Next page →


#89339

FromRichard Damon <Richard@Damon-Family.org>
Date2023-02-28 11:29 -0500
Message-ID<jZpLL.908931$8_id.711394@fx09.iad>
In reply to#89334
On 2/28/23 10:12 AM, Malcolm McLean wrote:
> On Tuesday, 28 February 2023 at 14:39:37 UTC, Richard Damon wrote:
>> On 2/28/23 8:42 AM, Malcolm McLean wrote:
>>> On Tuesday, 28 February 2023 at 13:10:46 UTC, Richard Damon wrote:
>>>> On 2/28/23 6:19 AM, Malcolm McLean wrote:
>>>>> On Tuesday, 28 February 2023 at 08:38:43 UTC, Mut...@dastardlyhq.com wrote:
>>>>>>
>>>>>> I've written C and C++ in aerospace including Misra C to SIL4 standard and
>>>>>> even that doesn't spoon feed the developer to bounds check their array indexes
>>>>>> as its a given than any half decent developer would do it where required.
>>>>>>
>>>>> It's a question of "defensive programming".
>>>>>
>>>>> With the code fragment
>>>>> void deleteentry(OBJECT *obj, int N, int index)
>>>>> {
>>>>> if (index >= 0 && index < N)
>>>>> /* do deletion */
>>>>> }
>>>>>
>>>>> We suppress a crash if index is out of bounds. But that makes it harder to find the
>>>>> place where the index calculation goes wrong. So it's very debateable whether to keep
>>>>> the test in.
>>>> Well, the answer to that is we should have an else clause that at
>>>> minimum logs the error, and perhaps core dumps and ends.
>>>>
>>> Generally you can't log the error, at least in a production setting.
>>> For example my code is ultimately released as a drawing package for artists.
>>> It's not acceptable to log an error, because that would generate calls to
>>> customer support which we wouldn't be able to handle effectively. That's
>>> quite common. In any sort of consumer / end user setting, it's not usually
>>> appropriate to involve the customer in debugging.
>>>
>> No, you can still generally "log" the error, you just do it in a way
>> that the customer can't normally see. You likely want the log to auto
>> clear after some time, but then if the customer DOES have an issue and
>> contacts support, they can do something to retrieve recent problem reports.
>>
>> Sort of like your car, there are lots of errors that might occur that
>> get put into the internal log that don't bring up an "idiot" light, and
>> at service time they can check for problems, or if a light does come on,
>> they can look at the log to diagnose.
>>
> The decision to set up that sort of log is taken by the people who design the
> system, in that case probably the systems architect appointed by the automobile
> manufacturer. He might then provide an interface so that third party
> programmers can access the system and generate reports.
> But I can't really set up a logging system myself, in the absence of a package-wide
> system. We could make it work, of course, but it would be inappropriate. Though in
> fact we are in the process of developing a company wide logging system to log
> the usage patterns of our portions of the software. I couldn't untilaterally decide
> to extend or abuse that to log programming errors, however .
> In most programming, you are seldom working on a one man project where you
> are taking all the decisions yourself.

But if you are working on a project, you are not a passive slave to that 
project, but can suggest improvements to the infrastructure.

Yes, if the improvements are rejected, then it isn't your problem.

I suppose that is the difference between a developer, and a coder.

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


#89336

FromDavid Brown <david.brown@hesbynett.no>
Date2023-02-28 16:45 +0100
Message-ID<ttl7it$3kv5d$4@dont-email.me>
In reply to#89332
On 28/02/2023 14:42, Malcolm McLean wrote:
> On Tuesday, 28 February 2023 at 13:10:46 UTC, Richard Damon wrote:
>> On 2/28/23 6:19 AM, Malcolm McLean wrote:
>>> On Tuesday, 28 February 2023 at 08:38:43 UTC, Mut...@dastardlyhq.com wrote:
>>>>
>>>> I've written C and C++ in aerospace including Misra C to SIL4 standard and
>>>> even that doesn't spoon feed the developer to bounds check their array indexes
>>>> as its a given than any half decent developer would do it where required.
>>>>
>>> It's a question of "defensive programming".
>>>
>>> With the code fragment
>>> void deleteentry(OBJECT *obj, int N, int index)
>>> {
>>> if (index >= 0 && index < N)
>>> /* do deletion */
>>> }
>>>
>>> We suppress a crash if index is out of bounds. But that makes it harder to find the
>>> place where the index calculation goes wrong. So it's very debateable whether to keep
>>> the test in.

Indeed.  You might have extra tests during testing and debugging phases, 
to help track errors.  And sometimes you have no option but to release 
code that you don't know for sure is correct - programmers don't always 
get to decide on release plans.

>> Well, the answer to that is we should have an else clause that at
>> minimum logs the error, and perhaps core dumps and ends.
>>
> Generally you can't log the error, at least in a production setting.

Generally, there is no "generally".  There are endless varieties of what 
might be called a "production setting", with an almost endless variety 
of how to handle situations like this.

> For example my code is ultimately released as a drawing package for artists.
> It's not acceptable to log an error, because that would generate calls to
> customer support which we wouldn't be able to handle effectively. That's
> quite common. In any sort of consumer / end user setting, it's not usually
> appropriate to involve the customer in debugging.
>   

Right, so it is better to let the customers continue to pay for and use 
buggy software than to learn about and fix the problems?  That might be 
appropriate in some cases - and certainly I appreciate that it rarely 
helps to have lots of people report the same bug to customer support.




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


#89342

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2023-02-28 11:31 -0800
Message-ID<4860e54c-8d68-4886-bb22-40e46ab5e3d5n@googlegroups.com>
In reply to#89336
On Tuesday, 28 February 2023 at 15:45:47 UTC, David Brown wrote:
> On 28/02/2023 14:42, Malcolm McLean wrote: 
> 
> > For example my code is ultimately released as a drawing package for artists. 
> > It's not acceptable to log an error, because that would generate calls to 
> > customer support which we wouldn't be able to handle effectively. That's 
> > quite common. In any sort of consumer / end user setting, it's not usually 
> > appropriate to involve the customer in debugging. 
> >
> Right, so it is better to let the customers continue to pay for and use 
> buggy software than to learn about and fix the problems? That might be 
> appropriate in some cases - and certainly I appreciate that it rarely 
> helps to have lots of people report the same bug to customer support.
>
We're a commercial company. Whilst of course we want to be honest, and we do want our software to be as good as possible, ultimately we're about making money. And customer support costs money. We offer good customer support for things that the support team can support, for example we can advise customers about their workflow and potentially save them very large amounts of artists' time, we can suggest tools which the customer has not found. But the support team can't fix bugs. They have to report bugs to the developers, who are us, and then a fix will cost at least a thousand pounds. Now the issue with logging errors isn't so much that the bug will be reported, as that the customer thinks he's done us a favour because he's dilgently noted down the error report and recorded it. So he expects a fix. And that will cost a thousand pounds. And if he doesn't get it, he'll think badly of us. And he knows if exactly the same bug crops up again, which might be after the "fix". A customer is a client, not a friend. You do try to be friendly and helpful. But ultimately his interests are not your interests.

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


#89343

FromDavid Brown <david.brown@hesbynett.no>
Date2023-02-28 20:59 +0100
Message-ID<ttlmen$3mjc9$1@dont-email.me>
In reply to#89342
On 28/02/2023 20:31, Malcolm McLean wrote:
> On Tuesday, 28 February 2023 at 15:45:47 UTC, David Brown wrote:
>> On 28/02/2023 14:42, Malcolm McLean wrote:
>> 
>>> For example my code is ultimately released as a drawing package
>>> for artists. It's not acceptable to log an error, because that
>>> would generate calls to customer support which we wouldn't be
>>> able to handle effectively. That's quite common. In any sort of
>>> consumer / end user setting, it's not usually appropriate to
>>> involve the customer in debugging.
>>> 
>> Right, so it is better to let the customers continue to pay for and
>> use buggy software than to learn about and fix the problems? That
>> might be appropriate in some cases - and certainly I appreciate
>> that it rarely helps to have lots of people report the same bug to
>> customer support.
>> 
> We're a commercial company. Whilst of course we want to be honest,
> and we do want our software to be as good as possible, ultimately
> we're about making money. And customer support costs money. We offer
> good customer support for things that the support team can support,
> for example we can advise customers about their workflow and
> potentially save them very large amounts of artists' time, we can
> suggest tools which the customer has not found. But the support team
> can't fix bugs. They have to report bugs to the developers, who are
> us, and then a fix will cost at least a thousand pounds. Now the
> issue with logging errors isn't so much that the bug will be
> reported, as that the customer thinks he's done us a favour because
> he's dilgently noted down the error report and recorded it. So he
> expects a fix. And that will cost a thousand pounds. And if he
> doesn't get it, he'll think badly of us. And he knows if exactly the
> same bug crops up again, which might be after the "fix". A customer
> is a client, not a friend. You do try to be friendly and helpful. But
> ultimately his interests are not your interests.
> 

Yes, I appreciate that, and it's fair enough - time and effort costs 
money.  It just looked a little like you were hiding problems, to avoid 
customer services being bothered!

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


#89370

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2023-03-01 14:29 -0800
Message-ID<ttojku$2kmh$3@dont-email.me>
In reply to#89332
On 2/28/2023 5:42 AM, Malcolm McLean wrote:
> On Tuesday, 28 February 2023 at 13:10:46 UTC, Richard Damon wrote:
>> On 2/28/23 6:19 AM, Malcolm McLean wrote:
>>> On Tuesday, 28 February 2023 at 08:38:43 UTC, Mut...@dastardlyhq.com wrote:
>>>>
>>>> I've written C and C++ in aerospace including Misra C to SIL4 standard and
>>>> even that doesn't spoon feed the developer to bounds check their array indexes
>>>> as its a given than any half decent developer would do it where required.
>>>>
>>> It's a question of "defensive programming".
>>>
>>> With the code fragment
>>> void deleteentry(OBJECT *obj, int N, int index)
>>> {
>>> if (index >= 0 && index < N)
>>> /* do deletion */
>>> }
>>>
>>> We suppress a crash if index is out of bounds. But that makes it harder to find the
>>> place where the index calculation goes wrong. So it's very debateable whether to keep
>>> the test in.
>> Well, the answer to that is we should have an else clause that at
>> minimum logs the error, and perhaps core dumps and ends.
>>
> Generally you can't log the error, at least in a production setting.
> For example my code is ultimately released as a drawing package for artists.
> It's not acceptable to log an error, because that would generate calls to
> customer support which we wouldn't be able to handle effectively. 

What type of error? A bad file name, or a seg fault?

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


#89335

FromDavid Brown <david.brown@hesbynett.no>
Date2023-02-28 16:37 +0100
Message-ID<ttl74l$3kv5d$3@dont-email.me>
In reply to#89326
On 28/02/2023 09:38, Muttley@dastardlyhq.com wrote:
> On Mon, 27 Feb 2023 18:31:35 +0100
> David Brown <david.brown@hesbynett.no> wrote:
>> On 27/02/2023 11:24, Muttley@dastardlyhq.com wrote:
>>> On Mon, 27 Feb 2023 10:40:55 +0100
>>> David Brown <david.brown@hesbynett.no> wrote:
>>>> I don't do array bounds checking.  I write code that accesses arrays
>>>> with the index value that is correct for the requirements of the program
>>>> - additional checks are therefore worse than useless.
>>>
>>> I wonder how many C programmers thought that only to see their masterpiece
>>> die in a heap?
>>>
>>> Unless you're only doing array access in a loop up to array size or via
>> literals
>>> then I suspect your code will come unstuck one day.
>>>
>>
>> I suspect you haven't a clue about how I work and what my code does.  I
>> suspect you have never learned anything about serious programming, but
>> merely had a few courses in C and C++ - that would explain why you don't
>> understand basic concepts such as specifications.
> 
> I've written C and C++ in aerospace including Misra C to SIL4 standard and
> even that doesn't spoon feed the developer to bounds check their array indexes
> as its a given than any half decent developer would do it where required.

I've done Misra and SIL too - and some of the rules involved are 
directly stupid and counter-productive.  (Most are good.)  For good 
quality, reliable hardware and software, following Misra and/or SIL 
reduces reliability.  Much of it is just about arse-covering - saying 
you followed these rules so that you won't get sued if something else 
goes wrong.

Blindly following rules - such as adding bounds checks for every array 
access - is just a small step above blind stupidity.

Write the code correctly, and you won't be adding extra checks.  You'll 
have checks where checks are useful because you are not sure of the 
validity of the data at that point.  But re-checking data that you know 
is valid is simply /wrong/.  It can be encouraged by lawyers, but that 
doesn't stop it making the software less reliable in total.

(For some kinds of aerospace work you must take into account the 
possibility of unpredictable errors due to radiation and single-event 
upsets.  Extra checks in software is, again, the wrong place to handle 
these - but sometimes it is not practical to handle them in the correct 
place with better hardware, ECC, redundancy, etc.  Extra checks may then 
be better than nothing.)


> I've probably forgotten more about writing secure software than you ever knew
> but if being patronising makes you feel better then go for it.

You have apparently forgotten the most important part.  Make good, clear 
specifications for your code, and stick to them.  In serious high 
reliability code, it is not unusual to /prove/ functions are correct 
according to the specifications - but you will at least expect 
comprehensive testing and code reviews.  When the specifications for 
each function is correct, and each function follows the specifications, 
the complete system is correct.  And it does not need extra pointless 
checks - they just hide problems, muddle the code, and make 
comprehensive system testing impossible.

So if you want a function with the spec:

// Function: small_power_of_ten
// Inputs: uint32_t x, x >= 0, x <= 6
// Outputs: uint32_t y = 10 ^ x

then you can implement it as:

uint32_t small_power_of_ten(uint32_t x) {
	constexpr uint32_t powers[7] = {
		1, 10, 100, 1000,
		10000, 100000, 1000000
	};
	return powers[x];
}

You should /not/ be adding an extra check for the array bounds in 
small_power_of_ten.  You should be checking that any function that calls 
this one does so with a valid input.  No function should ever call 
"small_power_of_ten" with a value above 6, because there is no 
specification for what will happen in such a case - that would clearly 
be a bug in the calling code.

And if you think it would be more useful in your code to have a function 
that accepted a wider range of inputs, then you should specify it:

// Function: small_power_of_ten_checked
// Inputs: uint32_t x
// Outputs: uint32_t y = 10 ^ x if x <= 6
// 	throws an exception if x > 6

That's a different function entirely.


> 
>> and fix the bugs, but obsessing about pointless checks for one
>> particular type of potential bugs is no help to anyone.  It's just an
>> excuse for not thinking and not paying attention to what you are doing.
> 
> Whatever you say. I'm surprised you even post to a C++ group as why would you
> need the safety benefits of the language when clearly you're a master of
> unchecked accesses? Real programmers don't bounds check arrays or check for
> valid pointer values before they use them - just do a Nike, right?
> 

You really do not understand, do you?

In good code, there are no out-of-bounds accesses.  But that is achieved 
by having code generate correct (and therefore valid) indices, not by 
checking them before use and trying to somehow magically have the called 
function fix the bug in the calling function.

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


#89338

FromMuttley@dastardlyhq.com
Date2023-02-28 15:56 +0000
Message-ID<ttl889$3l32g$1@dont-email.me>
In reply to#89335
On Tue, 28 Feb 2023 16:37:57 +0100
David Brown <david.brown@hesbynett.no> wrote:
>On 28/02/2023 09:38, Muttley@dastardlyhq.com wrote:
>> I've written C and C++ in aerospace including Misra C to SIL4 standard and
>> even that doesn't spoon feed the developer to bounds check their array
>indexes
>> as its a given than any half decent developer would do it where required.
>
>I've done Misra and SIL too - and some of the rules involved are 
>directly stupid and counter-productive.  (Most are good.)  For good 

There are a few odd choices yes. 

>quality, reliable hardware and software, following Misra and/or SIL 
>reduces reliability.  Much of it is just about arse-covering - saying 
>you followed these rules so that you won't get sued if something else 
>goes wrong.

Arse covering comes into it but a lot of it is very sensible.

>possibility of unpredictable errors due to radiation and single-event 
>upsets.  Extra checks in software is, again, the wrong place to handle 

If its a CPU register thats get zapped software is the only practical place to
handle it.

>comprehensive testing and code reviews.  When the specifications for 
>each function is correct, and each function follows the specifications, 
>the complete system is correct.  And it does not need extra pointless 

A function can follow specifications to the letter and still have hidden
bugs. And if you make the specifications so in depth as to account for every
eventuality then you end up debugging the specifications as well as the 
software. Something formal methods advocates tend to forget.

>// Function: small_power_of_ten
>// Inputs: uint32_t x, x >= 0, x <= 6
>// Outputs: uint32_t y = 10 ^ x
>
>then you can implement it as:
>
>uint32_t small_power_of_ten(uint32_t x) {
>	constexpr uint32_t powers[7] = {
>		1, 10, 100, 1000,
>		10000, 100000, 1000000
>	};
>	return powers[x];
>}
>
>You should /not/ be adding an extra check for the array bounds in 
>small_power_of_ten.  You should be checking that any function that calls 
>this one does so with a valid input.  No function should ever call 
>"small_power_of_ten" with a value above 6, because there is no 

And no one should ever steal either so I don't need a lock on my doors, right?

>specification for what will happen in such a case - that would clearly 
>be a bug in the calling code.

Its also a bug in your code in that it doesn't catch it.

>You really do not understand, do you?

I think I understand better than you. You seem to think complicated code can
be provenly correct. It can't without a huge amount of time and effort and
even then , its only as good as your spec in the first place.

>In good code, there are no out-of-bounds accesses.  But that is achieved 
>by having code generate correct (and therefore valid) indices, not by 
>checking them before use and trying to somehow magically have the called 
>function fix the bug in the calling function.

face <- palm

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


#89341

FromDavid Brown <david.brown@hesbynett.no>
Date2023-02-28 18:34 +0100
Message-ID<ttldui$3lmr9$2@dont-email.me>
In reply to#89338
On 28/02/2023 16:56, Muttley@dastardlyhq.com wrote:
> On Tue, 28 Feb 2023 16:37:57 +0100
> David Brown <david.brown@hesbynett.no> wrote:
>> On 28/02/2023 09:38, Muttley@dastardlyhq.com wrote:
>>> I've written C and C++ in aerospace including Misra C to SIL4 standard and
>>> even that doesn't spoon feed the developer to bounds check their array
>> indexes
>>> as its a given than any half decent developer would do it where required.
>>
>> I've done Misra and SIL too - and some of the rules involved are
>> directly stupid and counter-productive.  (Most are good.)  For good
> 
> There are a few odd choices yes.
> 
>> quality, reliable hardware and software, following Misra and/or SIL
>> reduces reliability.  Much of it is just about arse-covering - saying
>> you followed these rules so that you won't get sued if something else
>> goes wrong.
> 
> Arse covering comes into it but a lot of it is very sensible.
> 
>> possibility of unpredictable errors due to radiation and single-event
>> upsets.  Extra checks in software is, again, the wrong place to handle
> 
> If its a CPU register thats get zapped software is the only practical place to
> handle it.
> 

You are joking, right?

If there is a realistic possibility of cpu registers getting zapped, and 
the system is vital, you use redundant hardware.  You use something like 
a PPC or Cortex-R device with dual lock-step processors, or some other 
external redundancy checking hardware.  You don't cross your fingers and 
hope that the error happens to affect one register bit at one point in 
time, and that other register bits are not just as likely to be hit 
sooner or later.  Remember, it is just as likely for the cpu register 
holding the index value to get hit just /after/ your check as just 
/before/ your check - or the register holding the array base could be 
hit, or the program counter, or anything else.  Extra software checks 
can sometimes marginally improve your reliability, but only marginally - 
and it is usually /extremely/ difficult to quantify.

>> comprehensive testing and code reviews.  When the specifications for
>> each function is correct, and each function follows the specifications,
>> the complete system is correct.  And it does not need extra pointless
> 
> A function can follow specifications to the letter and still have hidden
> bugs.

The /specification/ can have bugs or be inappropriate in some way.  The 
/hardware/ can have bugs.  But if a piece of code gives the specified 
output and effects for the specified inputs, then it is correct and 
bug-free.

> And if you make the specifications so in depth as to account for every
> eventuality then you end up debugging the specifications as well as the
> software. Something formal methods advocates tend to forget.

You split things up into manageable pieces.

And yes, you need to get the specifications right - that is also part of 
the job of software design.  But again, you divide into parts and you 
divide the responsibilities (even if it is the same person doing 
everything).  Get the specifications right for a function, then 
implement the function trusting the specifications.  If you can't trust 
the specifications, you are not ready to code the function.


> 
>> // Function: small_power_of_ten
>> // Inputs: uint32_t x, x >= 0, x <= 6
>> // Outputs: uint32_t y = 10 ^ x
>>
>> then you can implement it as:
>>
>> uint32_t small_power_of_ten(uint32_t x) {
>> 	constexpr uint32_t powers[7] = {
>> 		1, 10, 100, 1000,
>> 		10000, 100000, 1000000
>> 	};
>> 	return powers[x];
>> }
>>
>> You should /not/ be adding an extra check for the array bounds in
>> small_power_of_ten.  You should be checking that any function that calls
>> this one does so with a valid input.  No function should ever call
>> "small_power_of_ten" with a value above 6, because there is no
> 
> And no one should ever steal either so I don't need a lock on my doors, right?
> 

You lock your front door, because that forms a boundary between areas of 
trust.  You don't lock your in-house doors because you trust those 
inside the house.

Check the parameters for calls from external source, not the inside ones.

>> specification for what will happen in such a case - that would clearly
>> be a bug in the calling code.
> 
> Its also a bug in your code in that it doesn't catch it.
> 

No, no, no.  Establish your responsibilities and who is doing what task. 
  The calling function must guarantee that it provides inputs according 
to the callee's specification.  The callee assumes these are valid.  It 
is not the callee's job to figure out what the caller did wrong - that 
would be impossible!  (Again, as always, you might be able to provide 
some help during debugging.)

>> You really do not understand, do you?
> 
> I think I understand better than you. You seem to think complicated code can
> be provenly correct. It can't without a huge amount of time and effort and
> even then , its only as good as your spec in the first place.
> 

Oh, I agree that code cannot be better than the specifications.  And I 
agree that complicated code (or complicated specifications) make things 
much more difficult.  That's why you divide things up into parts - both 
code and specifications - and handle them individually.  That's why you 
don't waste time and effort making things needlessly extra complicated 
by duplicating effort or mixing work that is supposed to be done in the 
separate tasks.  Let the caller do its job right, and let the callee 
trust its inputs - don't put the responsibility of getting the inputs 
right into the wrong task or function, or into /both/ tasks or functions.

>> In good code, there are no out-of-bounds accesses.  But that is achieved
>> by having code generate correct (and therefore valid) indices, not by
>> checking them before use and trying to somehow magically have the called
>> function fix the bug in the calling function.
> 

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


#89346

FromMuttley@dastardlyhq.com
Date2023-03-01 09:37 +0000
Message-ID<ttn6dg$3tq9p$1@dont-email.me>
In reply to#89341
On Tue, 28 Feb 2023 18:34:10 +0100
David Brown <david.brown@hesbynett.no> wrote:
>On 28/02/2023 16:56, Muttley@dastardlyhq.com wrote:
>> A function can follow specifications to the letter and still have hidden
>> bugs.
>
>The /specification/ can have bugs or be inappropriate in some way.  The 
>/hardware/ can have bugs.  But if a piece of code gives the specified 
>output and effects for the specified inputs, then it is correct and 
>bug-free.

Really?

Spec: function always returns 10

int func()
{
	char *ptr = 0;
	for(int i=0;i < 100000;++i) ptr[i] = 0;
	return 10;
}

Bug free?

>> And no one should ever steal either so I don't need a lock on my doors,
>right?
>> 
>
>You lock your front door, because that forms a boundary between areas of 
>trust.  You don't lock your in-house doors because you trust those 
>inside the house.

The function is the house in this metaphor, the rest of the program is outside.

>Oh, I agree that code cannot be better than the specifications.  And I 
>agree that complicated code (or complicated specifications) make things 
>much more difficult.  That's why you divide things up into parts - both 
>code and specifications - and handle them individually.  That's why you 

Perfectly working parts can still fail with bugs when put together as Ariane 5 
and Mars Climate Orbiter discovered. Format testing requires a formal system
test too, you can't ignore it if you want to do it properly.

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


#89348

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2023-03-01 02:29 -0800
Message-ID<1d5d6324-d5cd-4117-800d-649627a59f57n@googlegroups.com>
In reply to#89346
On Wednesday, 1 March 2023 at 09:38:08 UTC, Mut...@dastardlyhq.com wrote:
> On Tue, 28 Feb 2023 18:34:10 +0100 
> David Brown <david...@hesbynett.no> wrote:
> >On 28/02/2023 16:56, Mut...@dastardlyhq.com wrote: 
> >> A function can follow specifications to the letter and still have hidden 
> >> bugs. 
> > 
> >The /specification/ can have bugs or be inappropriate in some way. The 
> >/hardware/ can have bugs. But if a piece of code gives the specified 
> >output and effects for the specified inputs, then it is correct and 
> >bug-free.
> Really? 
> 
> Spec: function always returns 10 
> 
> int func() 
> { 
> char *ptr = 0; 
> for(int i=0;i < 100000;++i) ptr[i] = 0; 
> return 10; 
> } 
> 
> Bug free?
>
A better example would be

int func()
{
   char *ptr = malloc(1);
   return 10;
}

This function will always return 10, so it's to specification. But it's the source
of a bug.

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


#89364

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2023-03-01 19:56 +0000
Message-ID<87a60ws0ti.fsf@bsb.me.uk>
In reply to#89348
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

> On Wednesday, 1 March 2023 at 09:38:08 UTC, Mut...@dastardlyhq.com wrote:
>> On Tue, 28 Feb 2023 18:34:10 +0100 
>> David Brown <david...@hesbynett.no> wrote:
>> >On 28/02/2023 16:56, Mut...@dastardlyhq.com wrote: 
>> >> A function can follow specifications to the letter and still have hidden 
>> >> bugs. 
>> > 
>> >The /specification/ can have bugs or be inappropriate in some way. The 
>> >/hardware/ can have bugs. But if a piece of code gives the specified 
>> >output and effects for the specified inputs, then it is correct and 
>> >bug-free.
>> Really? 
>> 
>> Spec: function always returns 10 
>> 
>> int func() 
>> { 
>> char *ptr = 0; 
>> for(int i=0;i < 100000;++i) ptr[i] = 0; 
>> return 10; 
>> } 
>> 
>> Bug free?
>>
> A better example would be
>
> int func()
> {
>    char *ptr = malloc(1);
>    return 10;
> }
>
> This function will always return 10, so it's to specification. But
> it's the source of a bug.

This is a better example (because it has defined behaviour), but does
the function meet the specification?  I would say that, speaking
informally, specifications are taken to be minimal.  Would

  int func() { getchar(); return 10; }

meet the specification as well?

-- 
Ben.

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


#89366

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2023-03-01 12:53 -0800
Message-ID<d068a704-c970-4310-bd5d-c16e6fa8fa4bn@googlegroups.com>
In reply to#89364
On Wednesday, 1 March 2023 at 19:56:23 UTC, Ben Bacarisse wrote:
> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
> 
> > On Wednesday, 1 March 2023 at 09:38:08 UTC, Mut...@dastardlyhq.com wrote: 
> >> On Tue, 28 Feb 2023 18:34:10 +0100 
> >> David Brown <david...@hesbynett.no> wrote: 
> >> >On 28/02/2023 16:56, Mut...@dastardlyhq.com wrote: 
> >> >> A function can follow specifications to the letter and still have hidden 
> >> >> bugs. 
> >> > 
> >> >The /specification/ can have bugs or be inappropriate in some way. The 
> >> >/hardware/ can have bugs. But if a piece of code gives the specified 
> >> >output and effects for the specified inputs, then it is correct and 
> >> >bug-free. 
> >> Really? 
> >> 
> >> Spec: function always returns 10 
> >> 
> >> int func() 
> >> { 
> >> char *ptr = 0; 
> >> for(int i=0;i < 100000;++i) ptr[i] = 0; 
> >> return 10; 
> >> } 
> >> 
> >> Bug free? 
> >> 
> > A better example would be 
> > 
> > int func() 
> > { 
> > char *ptr = malloc(1); 
> > return 10; 
> > } 
> > 
> > This function will always return 10, so it's to specification. But 
> > it's the source of a bug.
> This is a better example (because it has defined behaviour), but does 
> the function meet the specification? I would say that, speaking 
> informally, specifications are taken to be minimal. Would 
> 
> int func() { getchar(); return 10; } 
> 
> meet the specification as well? 
> 
This is where you get trapped by C's misuse of the term "function".
If the term "function" were used in the proper mathematical sense,
then the program's memory would be in one state on function entry and
another on function return, and so you can't have a function without a
specification. 
But C "functions" can perform actions. Specifying correct actions is a whole
different ball game to specifying functions, which are just mappings from
one set to another.

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


#89367

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2023-03-01 21:13 +0000
Message-ID<874jr4rx8b.fsf@bsb.me.uk>
In reply to#89366
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

> On Wednesday, 1 March 2023 at 19:56:23 UTC, Ben Bacarisse wrote:
>> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
>> 
>> > On Wednesday, 1 March 2023 at 09:38:08 UTC, Mut...@dastardlyhq.com wrote: 
>> >> On Tue, 28 Feb 2023 18:34:10 +0100 
>> >> David Brown <david...@hesbynett.no> wrote: 
>> >> >On 28/02/2023 16:56, Mut...@dastardlyhq.com wrote: 
>> >> >> A function can follow specifications to the letter and still have hidden 
>> >> >> bugs. 
>> >> > 
>> >> >The /specification/ can have bugs or be inappropriate in some way. The 
>> >> >/hardware/ can have bugs. But if a piece of code gives the specified 
>> >> >output and effects for the specified inputs, then it is correct and 
>> >> >bug-free. 
>> >> Really? 
>> >> 
>> >> Spec: function always returns 10 
>> >> 
>> >> int func() 
>> >> { 
>> >> char *ptr = 0; 
>> >> for(int i=0;i < 100000;++i) ptr[i] = 0; 
>> >> return 10; 
>> >> } 
>> >> 
>> >> Bug free? 
>> >> 
>> > A better example would be 
>> > 
>> > int func() 
>> > { 
>> > char *ptr = malloc(1); 
>> > return 10; 
>> > } 
>> > 
>> > This function will always return 10, so it's to specification. But 
>> > it's the source of a bug.
>> This is a better example (because it has defined behaviour), but does 
>> the function meet the specification? I would say that, speaking 
>> informally, specifications are taken to be minimal. Would 
>> 
>> int func() { getchar(); return 10; } 
>> 
>> meet the specification as well? 
>> 
> This is where you get trapped by C's misuse of the term "function".
> If the term "function" were used in the proper mathematical sense,
> then the program's memory would be in one state on function entry and
> another on function return, and so you can't have a function without a
> specification.

No, that's not the issue.  Of course it would help if functions were
functions, but the terminology is not the issue here.  A sin function
(in some unimpeachable language like Haskell) that did all sorts of
other computations and took an hour, or used half the available memory,
would not meet the specification because, in my book, the specification
should be taken to be minimal.

> But C "functions" can perform actions. Specifying correct actions is a whole
> different ball game to specifying functions, which are just mappings from
> one set to another.

So lets' call them all "procedures" for the moment and get back to the
question at hand.  Should a specification be taken to be essentially
minimal?  I would say so.

-- 
Ben.

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


#89380

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2023-03-02 01:48 -0800
Message-ID<25e79655-f3a1-457e-afdd-f8004e4d4104n@googlegroups.com>
In reply to#89367
On Wednesday, 1 March 2023 at 21:13:59 UTC, Ben Bacarisse wrote:
> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
> 
> > On Wednesday, 1 March 2023 at 19:56:23 UTC, Ben Bacarisse wrote: 
> >> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
> >> 
> >> > On Wednesday, 1 March 2023 at 09:38:08 UTC, Mut...@dastardlyhq.com wrote: 
> >> >> On Tue, 28 Feb 2023 18:34:10 +0100 
> >> >> David Brown <david...@hesbynett.no> wrote: 
> >> >> >On 28/02/2023 16:56, Mut...@dastardlyhq.com wrote: 
> >> >> >> A function can follow specifications to the letter and still have hidden 
> >> >> >> bugs. 
> >> >> > 
> >> >> >The /specification/ can have bugs or be inappropriate in some way. The 
> >> >> >/hardware/ can have bugs. But if a piece of code gives the specified 
> >> >> >output and effects for the specified inputs, then it is correct and 
> >> >> >bug-free. 
> >> >> Really? 
> >> >> 
> >> >> Spec: function always returns 10 
> >> >> 
> >> >> int func() 
> >> >> { 
> >> >> char *ptr = 0; 
> >> >> for(int i=0;i < 100000;++i) ptr[i] = 0; 
> >> >> return 10; 
> >> >> } 
> >> >> 
> >> >> Bug free? 
> >> >> 
> >> > A better example would be 
> >> > 
> >> > int func() 
> >> > { 
> >> > char *ptr = malloc(1); 
> >> > return 10; 
> >> > } 
> >> > 
> >> > This function will always return 10, so it's to specification. But 
> >> > it's the source of a bug. 
> >> This is a better example (because it has defined behaviour), but does 
> >> the function meet the specification? I would say that, speaking 
> >> informally, specifications are taken to be minimal. Would 
> >> 
> >> int func() { getchar(); return 10; } 
> >> 
> >> meet the specification as well? 
> >> 
> > This is where you get trapped by C's misuse of the term "function". 
> > If the term "function" were used in the proper mathematical sense, 
> > then the program's memory would be in one state on function entry and 
> > another on function return, and so you can't have a function without a 
> > specification.
> No, that's not the issue. Of course it would help if functions were 
> functions, but the terminology is not the issue here. A sin function 
> (in some unimpeachable language like Haskell) that did all sorts of 
> other computations and took an hour, or used half the available memory, 
> would not meet the specification because, in my book, the specification 
> should be taken to be minimal.
> > But C "functions" can perform actions. Specifying correct actions is a whole 
> > different ball game to specifying functions, which are just mappings from 
> > one set to another.
> So lets' call them all "procedures" for the moment and get back to the 
> question at hand. Should a specification be taken to be essentially 
> minimal? I would say so. 
> 
If functions are functions then the bits on function entry define the
state of the bits on function exit, and if they match, the function is
correct. Programming functions often have an additional specification
in terms of Big O running time.  It is of course possible to break the
spirit of this by writing code which is formally O(N) but in reality is
much slower for any likely N than a naive O(N squared) function. However
normally you have to either be perverse or to be using a weird and wonderful
recasting of the problem to do this.

Often there's a straightforwards way of calculating a function, and a more
complicated way which has advantages of speed, numerical stability,
or the szie of input it can handle. Sometimes intermediate calculations
are mathematically unnecessary, but they make it easier for a human reading
the code to follow along.

I don't think we can fairly say that a piece of code must optimise something
(execution speed, clarity, size of data accepted, code size) before it is "to
specification". But maybe we can say that it mustn't grossly pessimise
anything. There's a kind of implied specification in any instruction. If I say "get me
a cup of tea" then either a mug or a teacup would meet the instruction. But
not a sporting trophy filled with tea. I'd legitimately complain that my instructions
had been interpreted perversely.

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


#89417

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2023-03-03 21:44 +0000
Message-ID<87o7p9wluy.fsf@bsb.me.uk>
In reply to#89380
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

> On Wednesday, 1 March 2023 at 21:13:59 UTC, Ben Bacarisse wrote:
>> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
>> 
>> > On Wednesday, 1 March 2023 at 19:56:23 UTC, Ben Bacarisse wrote: 
>> >> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
>> >> 
>> >> > On Wednesday, 1 March 2023 at 09:38:08 UTC, Mut...@dastardlyhq.com wrote: 
>> >> >> On Tue, 28 Feb 2023 18:34:10 +0100 
>> >> >> David Brown <david...@hesbynett.no> wrote: 
>> >> >> >On 28/02/2023 16:56, Mut...@dastardlyhq.com wrote: 
>> >> >> >> A function can follow specifications to the letter and still have hidden 
>> >> >> >> bugs. 
>> >> >> > 
>> >> >> >The /specification/ can have bugs or be inappropriate in some way. The 
>> >> >> >/hardware/ can have bugs. But if a piece of code gives the specified 
>> >> >> >output and effects for the specified inputs, then it is correct and 
>> >> >> >bug-free. 
>> >> >> Really? 
>> >> >> 
>> >> >> Spec: function always returns 10 
>> >> >> 
>> >> >> int func() 
>> >> >> { 
>> >> >> char *ptr = 0; 
>> >> >> for(int i=0;i < 100000;++i) ptr[i] = 0; 
>> >> >> return 10; 
>> >> >> } 
>> >> >> 
>> >> >> Bug free? 
>> >> >> 
>> >> > A better example would be 
>> >> > 
>> >> > int func() 
>> >> > { 
>> >> > char *ptr = malloc(1); 
>> >> > return 10; 
>> >> > } 
>> >> > 
>> >> > This function will always return 10, so it's to specification. But 
>> >> > it's the source of a bug. 
>> >> This is a better example (because it has defined behaviour), but does 
>> >> the function meet the specification? I would say that, speaking 
>> >> informally, specifications are taken to be minimal. Would 
>> >> 
>> >> int func() { getchar(); return 10; } 
>> >> 
>> >> meet the specification as well? 
>> >> 
>> > This is where you get trapped by C's misuse of the term "function". 
>> > If the term "function" were used in the proper mathematical sense, 
>> > then the program's memory would be in one state on function entry and 
>> > another on function return, and so you can't have a function without a 
>> > specification.
>> No, that's not the issue. Of course it would help if functions were 
>> functions, but the terminology is not the issue here. A sin function 
>> (in some unimpeachable language like Haskell) that did all sorts of 
>> other computations and took an hour, or used half the available memory, 
>> would not meet the specification because, in my book, the specification 
>> should be taken to be minimal.
>> > But C "functions" can perform actions. Specifying correct actions is a whole 
>> > different ball game to specifying functions, which are just mappings from 
>> > one set to another.
>> So lets' call them all "procedures" for the moment and get back to the 
>> question at hand. Should a specification be taken to be essentially 
>> minimal? I would say so. 
>> 
> If functions are functions then the bits on function entry define the
> state of the bits on function exit, and if they match, the function is
> correct.

I think the first "functions" refers to C function but second does not
refer to either mathematical functions nor, say, functions in Haskell so
I think you are talking about what I once referred to as
Malcolm-functions.  Unfortunately I don't remember enough about what you
mean by the term to do anything but agree with the consequent.

> Programming functions often have an additional specification
> in terms of Big O running time.  It is of course possible to break the
> spirit of this by writing code which is formally O(N) but in reality is
> much slower for any likely N than a naive O(N squared) function. However
> normally you have to either be perverse or to be using a weird and wonderful
> recasting of the problem to do this.

I think you are agreeing: that a specification should be taken to be,
loosely speaking, minimal.

> Often there's a straightforwards way of calculating a function, and a more
> complicated way which has advantages of speed, numerical stability,
> or the szie of input it can handle. Sometimes intermediate calculations
> are mathematically unnecessary, but they make it easier for a human reading
> the code to follow along.
>
> I don't think we can fairly say that a piece of code must optimise
> something (execution speed, clarity, size of data accepted, code size)
> before it is "to specification". But maybe we can say that it mustn't
> grossly pessimise anything.

Yes.  That was my point.  Your example did not meet the specification
because is was perversely not a minimal implementation.

> There's a kind of implied specification in
> any instruction. If I say "get me a cup of tea" then either a mug or a
> teacup would meet the instruction. But not a sporting trophy filled
> with tea. I'd legitimately complain that my instructions had been
> interpreted perversely.

Yes.  I think we are having an agreement.

-- 
Ben.

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


#89418

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2023-03-03 20:16 -0800
Message-ID<55764440-3765-4f08-9b48-05853042ab52n@googlegroups.com>
In reply to#89417
On Friday, 3 March 2023 at 21:45:09 UTC, Ben Bacarisse wrote:
> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
> 
> > On Wednesday, 1 March 2023 at 21:13:59 UTC, Ben Bacarisse wrote: 
> >> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
> >> 
> >> > On Wednesday, 1 March 2023 at 19:56:23 UTC, Ben Bacarisse wrote: 
> >> >> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
> >> >> 
> >> >> > On Wednesday, 1 March 2023 at 09:38:08 UTC, Mut...@dastardlyhq.com wrote: 
> >> >> >> On Tue, 28 Feb 2023 18:34:10 +0100 
> >> >> >> David Brown <david...@hesbynett.no> wrote: 
> >> >> >> >On 28/02/2023 16:56, Mut...@dastardlyhq.com wrote: 
> >> >> >> >> A function can follow specifications to the letter and still have hidden 
> >> >> >> >> bugs. 
> >> >> >> > 
> >> >> >> >The /specification/ can have bugs or be inappropriate in some way. The 
> >> >> >> >/hardware/ can have bugs. But if a piece of code gives the specified 
> >> >> >> >output and effects for the specified inputs, then it is correct and 
> >> >> >> >bug-free. 
> >> >> >> Really? 
> >> >> >> 
> >> >> >> Spec: function always returns 10 
> >> >> >> 
> >> >> >> int func() 
> >> >> >> { 
> >> >> >> char *ptr = 0; 
> >> >> >> for(int i=0;i < 100000;++i) ptr[i] = 0; 
> >> >> >> return 10; 
> >> >> >> } 
> >> >> >> 
> >> >> >> Bug free? 
> >> >> >> 
> >> >> > A better example would be 
> >> >> > 
> >> >> > int func() 
> >> >> > { 
> >> >> > char *ptr = malloc(1); 
> >> >> > return 10; 
> >> >> > } 
> >> >> > 
> >> >> > This function will always return 10, so it's to specification. But 
> >> >> > it's the source of a bug. 
> >> >> This is a better example (because it has defined behaviour), but does 
> >> >> the function meet the specification? I would say that, speaking 
> >> >> informally, specifications are taken to be minimal. Would 
> >> >> 
> >> >> int func() { getchar(); return 10; } 
> >> >> 
> >> >> meet the specification as well? 
> >> >> 
> >> > This is where you get trapped by C's misuse of the term "function". 
> >> > If the term "function" were used in the proper mathematical sense, 
> >> > then the program's memory would be in one state on function entry and 
> >> > another on function return, and so you can't have a function without a 
> >> > specification. 
> >> No, that's not the issue. Of course it would help if functions were 
> >> functions, but the terminology is not the issue here. A sin function 
> >> (in some unimpeachable language like Haskell) that did all sorts of 
> >> other computations and took an hour, or used half the available memory, 
> >> would not meet the specification because, in my book, the specification 
> >> should be taken to be minimal. 
> >> > But C "functions" can perform actions. Specifying correct actions is a whole 
> >> > different ball game to specifying functions, which are just mappings from 
> >> > one set to another. 
> >> So lets' call them all "procedures" for the moment and get back to the 
> >> question at hand. Should a specification be taken to be essentially 
> >> minimal? I would say so. 
> >> 
> > If functions are functions then the bits on function entry define the 
> > state of the bits on function exit, and if they match, the function is 
> > correct.
> I think the first "functions" refers to C function but second does not 
> refer to either mathematical functions nor, say, functions in Haskell so 
> I think you are talking about what I once referred to as 
> Malcolm-functions. Unfortunately I don't remember enough about what you 
> mean by the term to do anything but agree with the consequent.
>
A Malcolm function is that subset of mathematical functions which can
be implemented by programming languages. A mathematical function is
a mapping from an input set to an output set such that for every member
of the input set there is one and only member of the output set. Since
Malcolm functions are programming entities, the input set has to ultimately
be bits, and the output set also ultimately has to be bits. So bits on function
entry determines bits on function exit. Unlike "pure functions" there are no
special syntactical or data hiding requirement  on Malcolm functions. To
all intents and purposes, the term is identical in meaning to the term "function", 
used in the accepted sense in a  computer context, not in the C sense to 
mean "subroutine".

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


#89436

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2023-03-04 22:55 +0000
Message-ID<87fsaknn3c.fsf@bsb.me.uk>
In reply to#89418
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

> On Friday, 3 March 2023 at 21:45:09 UTC, Ben Bacarisse wrote:
>> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
>> 
>> > On Wednesday, 1 March 2023 at 21:13:59 UTC, Ben Bacarisse wrote: 
>> >> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
>> >> 
>> >> > On Wednesday, 1 March 2023 at 19:56:23 UTC, Ben Bacarisse wrote: 
>> >> >> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
>> >> >> 
>> >> >> > On Wednesday, 1 March 2023 at 09:38:08 UTC, Mut...@dastardlyhq.com wrote: 
>> >> >> >> On Tue, 28 Feb 2023 18:34:10 +0100 
>> >> >> >> David Brown <david...@hesbynett.no> wrote: 
>> >> >> >> >On 28/02/2023 16:56, Mut...@dastardlyhq.com wrote: 
>> >> >> >> >> A function can follow specifications to the letter and still have hidden 
>> >> >> >> >> bugs. 
>> >> >> >> > 
>> >> >> >> >The /specification/ can have bugs or be inappropriate in some way. The 
>> >> >> >> >/hardware/ can have bugs. But if a piece of code gives the specified 
>> >> >> >> >output and effects for the specified inputs, then it is correct and 
>> >> >> >> >bug-free. 
>> >> >> >> Really? 
>> >> >> >> 
>> >> >> >> Spec: function always returns 10 
>> >> >> >> 
>> >> >> >> int func() 
>> >> >> >> { 
>> >> >> >> char *ptr = 0; 
>> >> >> >> for(int i=0;i < 100000;++i) ptr[i] = 0; 
>> >> >> >> return 10; 
>> >> >> >> } 
>> >> >> >> 
>> >> >> >> Bug free? 
>> >> >> >> 
>> >> >> > A better example would be 
>> >> >> > 
>> >> >> > int func() 
>> >> >> > { 
>> >> >> > char *ptr = malloc(1); 
>> >> >> > return 10; 
>> >> >> > } 
>> >> >> > 
>> >> >> > This function will always return 10, so it's to specification. But 
>> >> >> > it's the source of a bug. 
>> >> >> This is a better example (because it has defined behaviour), but does 
>> >> >> the function meet the specification? I would say that, speaking 
>> >> >> informally, specifications are taken to be minimal. Would 
>> >> >> 
>> >> >> int func() { getchar(); return 10; } 
>> >> >> 
>> >> >> meet the specification as well? 
>> >> >> 
>> >> > This is where you get trapped by C's misuse of the term "function". 
>> >> > If the term "function" were used in the proper mathematical sense, 
>> >> > then the program's memory would be in one state on function entry and 
>> >> > another on function return, and so you can't have a function without a 
>> >> > specification. 
>> >> No, that's not the issue. Of course it would help if functions were 
>> >> functions, but the terminology is not the issue here. A sin function 
>> >> (in some unimpeachable language like Haskell) that did all sorts of 
>> >> other computations and took an hour, or used half the available memory, 
>> >> would not meet the specification because, in my book, the specification 
>> >> should be taken to be minimal. 
>> >> > But C "functions" can perform actions. Specifying correct actions is a whole 
>> >> > different ball game to specifying functions, which are just mappings from 
>> >> > one set to another. 
>> >> So lets' call them all "procedures" for the moment and get back to the 
>> >> question at hand. Should a specification be taken to be essentially 
>> >> minimal? I would say so. 
>> >> 
>> > If functions are functions then the bits on function entry define the 
>> > state of the bits on function exit, and if they match, the function is 
>> > correct.
>> I think the first "functions" refers to C function but second does not 
>> refer to either mathematical functions nor, say, functions in Haskell so 
>> I think you are talking about what I once referred to as 
>> Malcolm-functions. Unfortunately I don't remember enough about what you 
>> mean by the term to do anything but agree with the consequent.
>>
> A Malcolm function is that subset of mathematical functions which can
> be implemented by programming languages. A mathematical function is a
> mapping from an input set to an output set such that for every member
> of the input set there is one and only member of the output set. Since
> Malcolm functions are programming entities, the input set has to
> ultimately be bits, and the output set also ultimately has to be
> bits. So bits on function entry determines bits on function
> exit. Unlike "pure functions" there are no special syntactical or data
> hiding requirement on Malcolm functions. To all intents and purposes,
> the term is identical in meaning to the term "function", used in the
> accepted sense in a computer context, not in the C sense to mean
> "subroutine".

I don't know what bits are involved.  You can't mean just the bits in
the parameter and return values or

  int func() { getchar(); return 10; }

would be a Malcolm function, and you can't mean all the bits in the
entire (virtual) system or the specification for such a function would
be ridiculous.

-- 
Ben.

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


#89442

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2023-03-05 07:11 -0800
Message-ID<369f1c30-4041-4461-bfbc-628e76aed744n@googlegroups.com>
In reply to#89436
On Saturday, 4 March 2023 at 22:55:37 UTC, Ben Bacarisse wrote:
> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
> 
> > On Friday, 3 March 2023 at 21:45:09 UTC, Ben Bacarisse wrote: 
> >> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
> >> 
> >> > On Wednesday, 1 March 2023 at 21:13:59 UTC, Ben Bacarisse wrote: 
> >> >> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
> >> >> 
> >> >> > On Wednesday, 1 March 2023 at 19:56:23 UTC, Ben Bacarisse wrote: 
> >> >> >> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
> >> >> >> 
> >> >> >> > On Wednesday, 1 March 2023 at 09:38:08 UTC, Mut...@dastardlyhq.com wrote: 
> >> >> >> >> On Tue, 28 Feb 2023 18:34:10 +0100 
> >> >> >> >> David Brown <david...@hesbynett.no> wrote: 
> >> >> >> >> >On 28/02/2023 16:56, Mut...@dastardlyhq.com wrote: 
> >> >> >> >> >> A function can follow specifications to the letter and still have hidden 
> >> >> >> >> >> bugs. 
> >> >> >> >> > 
> >> >> >> >> >The /specification/ can have bugs or be inappropriate in some way. The 
> >> >> >> >> >/hardware/ can have bugs. But if a piece of code gives the specified 
> >> >> >> >> >output and effects for the specified inputs, then it is correct and 
> >> >> >> >> >bug-free. 
> >> >> >> >> Really? 
> >> >> >> >> 
> >> >> >> >> Spec: function always returns 10 
> >> >> >> >> 
> >> >> >> >> int func() 
> >> >> >> >> { 
> >> >> >> >> char *ptr = 0; 
> >> >> >> >> for(int i=0;i < 100000;++i) ptr[i] = 0; 
> >> >> >> >> return 10; 
> >> >> >> >> } 
> >> >> >> >> 
> >> >> >> >> Bug free? 
> >> >> >> >> 
> >> >> >> > A better example would be 
> >> >> >> > 
> >> >> >> > int func() 
> >> >> >> > { 
> >> >> >> > char *ptr = malloc(1); 
> >> >> >> > return 10; 
> >> >> >> > } 
> >> >> >> > 
> >> >> >> > This function will always return 10, so it's to specification. But 
> >> >> >> > it's the source of a bug. 
> >> >> >> This is a better example (because it has defined behaviour), but does 
> >> >> >> the function meet the specification? I would say that, speaking 
> >> >> >> informally, specifications are taken to be minimal. Would 
> >> >> >> 
> >> >> >> int func() { getchar(); return 10; } 
> >> >> >> 
> >> >> >> meet the specification as well? 
> >> >> >> 
> >> >> > This is where you get trapped by C's misuse of the term "function". 
> >> >> > If the term "function" were used in the proper mathematical sense, 
> >> >> > then the program's memory would be in one state on function entry and 
> >> >> > another on function return, and so you can't have a function without a 
> >> >> > specification. 
> >> >> No, that's not the issue. Of course it would help if functions were 
> >> >> functions, but the terminology is not the issue here. A sin function 
> >> >> (in some unimpeachable language like Haskell) that did all sorts of 
> >> >> other computations and took an hour, or used half the available memory, 
> >> >> would not meet the specification because, in my book, the specification 
> >> >> should be taken to be minimal. 
> >> >> > But C "functions" can perform actions. Specifying correct actions is a whole 
> >> >> > different ball game to specifying functions, which are just mappings from 
> >> >> > one set to another. 
> >> >> So lets' call them all "procedures" for the moment and get back to the 
> >> >> question at hand. Should a specification be taken to be essentially 
> >> >> minimal? I would say so. 
> >> >> 
> >> > If functions are functions then the bits on function entry define the 
> >> > state of the bits on function exit, and if they match, the function is 
> >> > correct. 
> >> I think the first "functions" refers to C function but second does not 
> >> refer to either mathematical functions nor, say, functions in Haskell so 
> >> I think you are talking about what I once referred to as 
> >> Malcolm-functions. Unfortunately I don't remember enough about what you 
> >> mean by the term to do anything but agree with the consequent. 
> >> 
> > A Malcolm function is that subset of mathematical functions which can 
> > be implemented by programming languages. A mathematical function is a 
> > mapping from an input set to an output set such that for every member 
> > of the input set there is one and only member of the output set. Since 
> > Malcolm functions are programming entities, the input set has to 
> > ultimately be bits, and the output set also ultimately has to be 
> > bits. So bits on function entry determines bits on function 
> > exit. Unlike "pure functions" there are no special syntactical or data 
> > hiding requirement on Malcolm functions. To all intents and purposes, 
> > the term is identical in meaning to the term "function", used in the 
> > accepted sense in a computer context, not in the C sense to mean 
> > "subroutine".
> I don't know what bits are involved. You can't mean just the bits in 
> the parameter and return values or
> int func() { getchar(); return 10; }
> would be a Malcolm function, and you can't mean all the bits in the 
> entire (virtual) system or the specification for such a function would 
> be ridiculous. 
> 
A mathematical function doesn't cease to be a mathematical function
because its specification is ridiculous. If each possible bit state on code
entry  maps to one and only one possible bit state on code exit, and
the code doesn't do anything else, like turn LEDs on or off, then the
code is a "function" or if you prefer, a "Malcolm function".
 

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


#89455

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2023-03-05 20:44 +0000
Message-ID<87ilfflyh2.fsf@bsb.me.uk>
In reply to#89442
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

> On Saturday, 4 March 2023 at 22:55:37 UTC, Ben Bacarisse wrote:
>> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
>> 
>> > On Friday, 3 March 2023 at 21:45:09 UTC, Ben Bacarisse wrote: 
>> >> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
>> >> 
>> >> > On Wednesday, 1 March 2023 at 21:13:59 UTC, Ben Bacarisse wrote: 
>> >> >> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
>> >> >> 
>> >> >> > On Wednesday, 1 March 2023 at 19:56:23 UTC, Ben Bacarisse wrote: 
>> >> >> >> Malcolm McLean <malcolm.ar...@gmail.com> writes: 
>> >> >> >> 
>> >> >> >> > On Wednesday, 1 March 2023 at 09:38:08 UTC, Mut...@dastardlyhq.com wrote: 
>> >> >> >> >> On Tue, 28 Feb 2023 18:34:10 +0100 
>> >> >> >> >> David Brown <david...@hesbynett.no> wrote: 
>> >> >> >> >> >On 28/02/2023 16:56, Mut...@dastardlyhq.com wrote: 
>> >> >> >> >> >> A function can follow specifications to the letter and still have hidden 
>> >> >> >> >> >> bugs. 
>> >> >> >> >> > 
>> >> >> >> >> >The /specification/ can have bugs or be inappropriate in some way. The 
>> >> >> >> >> >/hardware/ can have bugs. But if a piece of code gives the specified 
>> >> >> >> >> >output and effects for the specified inputs, then it is correct and 
>> >> >> >> >> >bug-free. 
>> >> >> >> >> Really? 
>> >> >> >> >> 
>> >> >> >> >> Spec: function always returns 10 
>> >> >> >> >> 
>> >> >> >> >> int func() 
>> >> >> >> >> { 
>> >> >> >> >> char *ptr = 0; 
>> >> >> >> >> for(int i=0;i < 100000;++i) ptr[i] = 0; 
>> >> >> >> >> return 10; 
>> >> >> >> >> } 
>> >> >> >> >> 
>> >> >> >> >> Bug free? 
>> >> >> >> >> 
>> >> >> >> > A better example would be 
>> >> >> >> > 
>> >> >> >> > int func() 
>> >> >> >> > { 
>> >> >> >> > char *ptr = malloc(1); 
>> >> >> >> > return 10; 
>> >> >> >> > } 
>> >> >> >> > 
>> >> >> >> > This function will always return 10, so it's to specification. But 
>> >> >> >> > it's the source of a bug. 
>> >> >> >> This is a better example (because it has defined behaviour), but does 
>> >> >> >> the function meet the specification? I would say that, speaking 
>> >> >> >> informally, specifications are taken to be minimal. Would 
>> >> >> >> 
>> >> >> >> int func() { getchar(); return 10; } 
>> >> >> >> 
>> >> >> >> meet the specification as well? 
>> >> >> >> 
>> >> >> > This is where you get trapped by C's misuse of the term "function". 
>> >> >> > If the term "function" were used in the proper mathematical sense, 
>> >> >> > then the program's memory would be in one state on function entry and 
>> >> >> > another on function return, and so you can't have a function without a 
>> >> >> > specification. 
>> >> >> No, that's not the issue. Of course it would help if functions were 
>> >> >> functions, but the terminology is not the issue here. A sin function 
>> >> >> (in some unimpeachable language like Haskell) that did all sorts of 
>> >> >> other computations and took an hour, or used half the available memory, 
>> >> >> would not meet the specification because, in my book, the specification 
>> >> >> should be taken to be minimal. 
>> >> >> > But C "functions" can perform actions. Specifying correct actions is a whole 
>> >> >> > different ball game to specifying functions, which are just mappings from 
>> >> >> > one set to another. 
>> >> >> So lets' call them all "procedures" for the moment and get back to the 
>> >> >> question at hand. Should a specification be taken to be essentially 
>> >> >> minimal? I would say so. 
>> >> >> 
>> >> > If functions are functions then the bits on function entry define the 
>> >> > state of the bits on function exit, and if they match, the function is 
>> >> > correct. 
>> >> I think the first "functions" refers to C function but second does not 
>> >> refer to either mathematical functions nor, say, functions in Haskell so 
>> >> I think you are talking about what I once referred to as 
>> >> Malcolm-functions. Unfortunately I don't remember enough about what you 
>> >> mean by the term to do anything but agree with the consequent. 
>> >> 
>> > A Malcolm function is that subset of mathematical functions which can 
>> > be implemented by programming languages. A mathematical function is a 
>> > mapping from an input set to an output set such that for every member 
>> > of the input set there is one and only member of the output set. Since 
>> > Malcolm functions are programming entities, the input set has to 
>> > ultimately be bits, and the output set also ultimately has to be 
>> > bits. So bits on function entry determines bits on function 
>> > exit. Unlike "pure functions" there are no special syntactical or data 
>> > hiding requirement on Malcolm functions. To all intents and purposes, 
>> > the term is identical in meaning to the term "function", used in the 
>> > accepted sense in a computer context, not in the C sense to mean 
>> > "subroutine".
>> I don't know what bits are involved. You can't mean just the bits in 
>> the parameter and return values or
>> int func() { getchar(); return 10; }
>> would be a Malcolm function, and you can't mean all the bits in the 
>> entire (virtual) system or the specification for such a function would 
>> be ridiculous. 
>> 
> A mathematical function doesn't cease to be a mathematical function
> because its specification is ridiculous.

Of course.  And the same would be true of non-mathematical functions as
well.  I'm trying to find out how your functions are specified.  How is
the Malcolm function that "just returns 10" specified?

> If each possible bit state on code entry maps to one and only one
> possible bit state on code exit, and the code doesn't do anything
> else, like turn LEDs on or off, then the code is a "function" or if
> you prefer, a "Malcolm function".

So

  int f(int x) { extern int inc; return x + inc++; }

is a Malcolm function, yes?

-- 
Ben.

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


#89456

FromMr Flibble <flibble2@reddwarf.jmc.corp>
Date2023-03-05 21:00 +0000
Message-ID<1749a1a386c48d51$317$270558$3aa16cab@news.newsdemon.com>
In reply to#89455
On 05/03/2023 20:44, Ben Bacarisse wrote:
> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
> 
>> On Saturday, 4 March 2023 at 22:55:37 UTC, Ben Bacarisse wrote:
>>> Malcolm McLean <malcolm.ar...@gmail.com> writes:
>>>
>>>> On Friday, 3 March 2023 at 21:45:09 UTC, Ben Bacarisse wrote:
>>>>> Malcolm McLean <malcolm.ar...@gmail.com> writes:
>>>>>
>>>>>> On Wednesday, 1 March 2023 at 21:13:59 UTC, Ben Bacarisse wrote:
>>>>>>> Malcolm McLean <malcolm.ar...@gmail.com> writes:
>>>>>>>
>>>>>>>> On Wednesday, 1 March 2023 at 19:56:23 UTC, Ben Bacarisse wrote:
>>>>>>>>> Malcolm McLean <malcolm.ar...@gmail.com> writes:
>>>>>>>>>
>>>>>>>>>> On Wednesday, 1 March 2023 at 09:38:08 UTC, Mut...@dastardlyhq.com wrote:
>>>>>>>>>>> On Tue, 28 Feb 2023 18:34:10 +0100
>>>>>>>>>>> David Brown <david...@hesbynett.no> wrote:
>>>>>>>>>>>> On 28/02/2023 16:56, Mut...@dastardlyhq.com wrote:
>>>>>>>>>>>>> A function can follow specifications to the letter and still have hidden
>>>>>>>>>>>>> bugs.
>>>>>>>>>>>>
>>>>>>>>>>>> The /specification/ can have bugs or be inappropriate in some way. The
>>>>>>>>>>>> /hardware/ can have bugs. But if a piece of code gives the specified
>>>>>>>>>>>> output and effects for the specified inputs, then it is correct and
>>>>>>>>>>>> bug-free.
>>>>>>>>>>> Really?
>>>>>>>>>>>
>>>>>>>>>>> Spec: function always returns 10
>>>>>>>>>>>
>>>>>>>>>>> int func()
>>>>>>>>>>> {
>>>>>>>>>>> char *ptr = 0;
>>>>>>>>>>> for(int i=0;i < 100000;++i) ptr[i] = 0;
>>>>>>>>>>> return 10;
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> Bug free?
>>>>>>>>>>>
>>>>>>>>>> A better example would be
>>>>>>>>>>
>>>>>>>>>> int func()
>>>>>>>>>> {
>>>>>>>>>> char *ptr = malloc(1);
>>>>>>>>>> return 10;
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> This function will always return 10, so it's to specification. But
>>>>>>>>>> it's the source of a bug.
>>>>>>>>> This is a better example (because it has defined behaviour), but does
>>>>>>>>> the function meet the specification? I would say that, speaking
>>>>>>>>> informally, specifications are taken to be minimal. Would
>>>>>>>>>
>>>>>>>>> int func() { getchar(); return 10; }
>>>>>>>>>
>>>>>>>>> meet the specification as well?
>>>>>>>>>
>>>>>>>> This is where you get trapped by C's misuse of the term "function".
>>>>>>>> If the term "function" were used in the proper mathematical sense,
>>>>>>>> then the program's memory would be in one state on function entry and
>>>>>>>> another on function return, and so you can't have a function without a
>>>>>>>> specification.
>>>>>>> No, that's not the issue. Of course it would help if functions were
>>>>>>> functions, but the terminology is not the issue here. A sin function
>>>>>>> (in some unimpeachable language like Haskell) that did all sorts of
>>>>>>> other computations and took an hour, or used half the available memory,
>>>>>>> would not meet the specification because, in my book, the specification
>>>>>>> should be taken to be minimal.
>>>>>>>> But C "functions" can perform actions. Specifying correct actions is a whole
>>>>>>>> different ball game to specifying functions, which are just mappings from
>>>>>>>> one set to another.
>>>>>>> So lets' call them all "procedures" for the moment and get back to the
>>>>>>> question at hand. Should a specification be taken to be essentially
>>>>>>> minimal? I would say so.
>>>>>>>
>>>>>> If functions are functions then the bits on function entry define the
>>>>>> state of the bits on function exit, and if they match, the function is
>>>>>> correct.
>>>>> I think the first "functions" refers to C function but second does not
>>>>> refer to either mathematical functions nor, say, functions in Haskell so
>>>>> I think you are talking about what I once referred to as
>>>>> Malcolm-functions. Unfortunately I don't remember enough about what you
>>>>> mean by the term to do anything but agree with the consequent.
>>>>>
>>>> A Malcolm function is that subset of mathematical functions which can
>>>> be implemented by programming languages. A mathematical function is a
>>>> mapping from an input set to an output set such that for every member
>>>> of the input set there is one and only member of the output set. Since
>>>> Malcolm functions are programming entities, the input set has to
>>>> ultimately be bits, and the output set also ultimately has to be
>>>> bits. So bits on function entry determines bits on function
>>>> exit. Unlike "pure functions" there are no special syntactical or data
>>>> hiding requirement on Malcolm functions. To all intents and purposes,
>>>> the term is identical in meaning to the term "function", used in the
>>>> accepted sense in a computer context, not in the C sense to mean
>>>> "subroutine".
>>> I don't know what bits are involved. You can't mean just the bits in
>>> the parameter and return values or
>>> int func() { getchar(); return 10; }
>>> would be a Malcolm function, and you can't mean all the bits in the
>>> entire (virtual) system or the specification for such a function would
>>> be ridiculous.
>>>
>> A mathematical function doesn't cease to be a mathematical function
>> because its specification is ridiculous.
> 
> Of course.  And the same would be true of non-mathematical functions as
> well.  I'm trying to find out how your functions are specified.  How is
> the Malcolm function that "just returns 10" specified?
> 
>> If each possible bit state on code entry maps to one and only one
>> possible bit state on code exit, and the code doesn't do anything
>> else, like turn LEDs on or off, then the code is a "function" or if
>> you prefer, a "Malcolm function".
> 
> So
> 
>    int f(int x) { extern int inc; return x + inc++; }
> 
> is a Malcolm function, yes?

Mathematical functions don't have side-effects; f has side effects so 
isn't a mathematical function.

/Flibble

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


Page 6 of 11 — ← Prev page 1 … 4 5 [6] 7 8 … 11  Next page →

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


csiph-web