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


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

switch/extension for see below strongly needed

Started byfir <profesor.fir@gmail.com>
First post2026-05-17 00:03 +0200
Last post2026-05-27 01:05 +0000
Articles 20 on this page of 243 — 19 participants

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


Contents

  switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-17 00:03 +0200
    Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-17 01:08 +0100
      Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-16 18:21 -0700
        Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-17 12:16 +0100
          Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-17 15:04 +0200
            Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-17 15:08 +0200
          Re: switch/extension for see below strongly needed Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-05-17 06:48 -0700
            Re: switch/extension for see below strongly needed Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-05-17 14:43 +0000
              Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-17 16:53 +0100
              Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-17 18:24 +0200
                Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-17 17:56 +0100
                  Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-17 21:07 +0200
                  Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-18 08:56 +0200
                    Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-18 09:22 +0200
                      Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-18 10:35 +0200
                        Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-18 10:41 +0200
                        Re: switch/extension for see below strongly needed antispam@fricas.org (Waldek Hebisch) - 2026-05-18 16:47 +0000
                          Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-18 18:58 +0200
                            Using "extra" blocks to declare local variables (Was: switch/extension for see below strongly needed) gazelle@shell.xmission.com (Kenny McCormack) - 2026-05-19 05:48 +0000
                              Re: Using "extra" blocks to declare local variables (Was: switch/extension for see below strongly needed) David Brown <david.brown@hesbynett.no> - 2026-05-19 08:18 +0200
                                Re: Using "extra" blocks to declare local variables (Was: switch/extension for see below strongly needed) scott@slp53.sl.home (Scott Lurndal) - 2026-05-19 14:04 +0000
                                  Re: Using "extra" blocks to declare local variables (Was: switch/extension for see below strongly needed) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-05-22 23:44 -0700
                          Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-18 18:13 +0000
                            Re: switch/extension for see below strongly needed scott@slp53.sl.home (Scott Lurndal) - 2026-05-18 18:37 +0000
                            You are not allowed to use "the S word" in this ng. (Was: switch/extension for see below strongly needed) gazelle@shell.xmission.com (Kenny McCormack) - 2026-05-19 05:49 +0000
                        Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-18 18:35 +0100
                          Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-18 21:24 +0200
                            Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-18 21:48 +0100
                              Re: switch/extension for see below strongly needed Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-05-31 17:00 -0700
                          Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-18 14:23 -0700
                          Re: switch/extension for see below strongly needed Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-05-19 06:58 +0000
                            Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-19 11:55 +0100
                              Re: switch/extension for see below strongly needed Richard Harnden <richard.nospam@gmail.invalid> - 2026-05-19 12:15 +0100
                                Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-19 12:48 +0100
                                  Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-19 14:23 +0200
                                    Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-19 14:08 +0100
                                      Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-19 15:40 +0200
                                        Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-19 16:41 +0200
                                          Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-19 17:07 +0200
                                            Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-19 17:23 +0200
                                              Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-19 17:58 +0200
                                                Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-19 18:31 +0200
                                                  Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-19 18:38 +0200
                                                    Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-19 18:54 +0200
                                            Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-19 17:44 +0100
                                              Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-19 18:59 +0200
                                        Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-19 17:31 +0100
                                          Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-19 18:48 +0200
                                            Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-19 18:47 +0100
                                              Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-19 21:58 +0200
                                                Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-19 22:16 +0100
                                                  Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-20 08:59 +0200
                                                    Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-20 14:20 +0100
                                                      Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-20 16:22 +0200
                                                        Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-20 16:41 +0100
                                                          Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-20 19:51 +0200
                                                            Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-20 21:14 +0100
                                                              Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-21 08:45 +0200
                                                                Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-21 12:56 +0100
                                                                  Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-21 14:55 +0200
                                                                    Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-21 18:26 +0100
                                                                      Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-21 21:23 +0200
                                                                        Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-21 20:59 +0100
                                                                          Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-21 21:35 +0000
                                                                          Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-22 09:31 +0200
                                                                        Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-22 06:52 +0200
                                                                          Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-22 09:34 +0200
                                                                          Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-22 11:43 +0100
                                                                            Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-22 12:13 +0000
                                                                              Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-22 14:16 +0100
                                                                                Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-22 17:32 +0000
                                                                                  Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-22 20:27 +0100
                                                                                    Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-23 15:30 +0000
                                                                                      Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-23 17:59 +0100
                                                                              Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-23 07:56 +0200
                                                                          Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-22 11:41 +0100
                                                                            Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-22 13:31 +0200
                                                                              Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-22 13:42 +0100
                                                                                Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-22 15:11 +0200
                                                                                Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-22 14:57 +0000
                                                                                  Re: switch/extension for see below strongly needed scott@slp53.sl.home (Scott Lurndal) - 2026-05-22 16:16 +0000
                                                                                    Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-22 17:43 +0000
                                                                                      Re: switch/extension for see below strongly needed scott@slp53.sl.home (Scott Lurndal) - 2026-05-22 21:03 +0000
                                                                                        Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-22 22:02 +0000
                                                                                        Re: switch/extension for see below strongly needed Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-05-25 07:39 -0700
                                                                                  Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-22 17:53 +0100
                                                                                    Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-23 07:51 +0200
                                                                                      Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-23 10:58 +0100
                                                                                  Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-23 07:33 +0200
                                                                                    Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-24 02:48 +0000
                                                                                      Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-24 10:13 +0200
                                                                                      Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-24 12:30 +0100
                                                                                        Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-24 13:39 +0100
                                                                                        Re: switch/extension for see below strongly needed tTh <tth@none.invalid> - 2026-05-24 22:09 +0200
                                                                                          Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-24 21:48 +0100
                                                                                            Re: switch/extension for see below strongly needed scott@slp53.sl.home (Scott Lurndal) - 2026-05-24 22:04 +0000
                                                                                          Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-25 10:34 +0200
                                                                          Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-22 11:45 +0100
                                                                  Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-21 15:08 +0200
                                                                    Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-21 14:31 +0100
                                                                      Re: switch/extension for see below strongly needed Michael S <already5chosen@yahoo.com> - 2026-05-21 19:37 +0300
                                                                        Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-21 18:38 +0100
                                                                    Re: switch/extension for see below strongly needed James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-05-21 13:54 -0400
                                                                      Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-21 20:09 +0200
                                                                        Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-21 14:31 -0700
                                                                          Re: switch/extension for see below strongly needed James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-05-21 19:41 -0400
                                                                            Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-22 05:23 +0200
                                                                          Re: switch/extension for see below strongly needed Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-05-22 21:38 -0700
                                                                            Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-22 23:17 -0700
                                                                              Re: switch/extension for see below strongly needed Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-05-23 00:04 -0700
                                                                              Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-23 09:35 +0200
                                                                                Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-23 03:59 -0700
                                                                  Re: switch/extension for see below strongly needed James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-05-21 13:48 -0400
                                                                  Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-21 14:23 -0700
                                                                    Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-21 23:47 +0100
                                                                      Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-21 17:24 -0700
                                                                        Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-22 01:51 +0100
                                                                          Re: switch/extension for see below strongly needed scott@slp53.sl.home (Scott Lurndal) - 2026-05-22 14:04 +0000
                                                                            Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-22 16:16 +0100
                                                                              Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-22 17:47 +0200
                                                                                Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-22 17:35 +0100
                                                                                  Re: switch/extension for see below strongly needed scott@slp53.sl.home (Scott Lurndal) - 2026-05-22 20:57 +0000
                                                                                    Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-23 00:24 +0100
                                                                                  Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-23 11:46 +0200
                                                                                    Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-23 11:31 +0100
                                                                                      Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-23 13:51 +0200
                                                                                        Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-23 13:07 +0100
                                                                                          Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-23 14:35 +0200
                                                                                            Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-23 14:38 +0200
                                                                                          Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-23 20:46 -0700
                                                                                      Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-23 13:55 +0100
                                                                        Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-22 05:58 +0200
                                                                          Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-21 21:21 -0700
                                                                            Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-22 07:17 +0200
                                                                          Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-22 10:49 +0200
                                                                            Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-23 05:49 +0200
                                                                          Re: switch/extension for see below strongly needed James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-05-22 18:37 -0400
                                                                    Re: switch/extension for see below strongly needed James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-05-21 19:49 -0400
                                                                      Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-21 17:27 -0700
                                                                    Re: switch/extension for see below strongly needed Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-05-23 14:21 -0700
                                                                      Re: switch/extension for see below strongly needed Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-05-23 20:32 -0700
                                                                    Re: switch/extension for see below strongly needed Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-05-23 14:19 -0700
                                                                    Re: switch/extension for see below strongly needed Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-05-23 14:03 -0700
                                                      Re: switch/extension for see below strongly needed "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-20 16:39 -0700
                                                    Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-20 15:18 +0000
                                                      Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-20 17:38 +0200
                                                        Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-20 18:17 +0000
                                                          Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-21 09:56 +0200
                                                            Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-21 12:18 +0000
                                                              Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-21 15:16 +0200
                                                                Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-22 14:44 +0000
                                                                  Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-22 17:12 +0200
                                                                    Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-24 19:08 +0000
                                                                      Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-25 12:16 +0200
                                                                        Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-26 14:09 +0000
                                                                          Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-26 18:16 +0200
                                                              Re: switch/extension for see below strongly needed scott@slp53.sl.home (Scott Lurndal) - 2026-05-21 15:04 +0000
                                                      Re: switch/extension for see below strongly needed "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-20 16:47 -0700
                                                        Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-21 02:55 +0000
                                                      Re: switch/extension for see below strongly needed Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-05-23 21:12 -0700
                                                        Re: switch/extension for see below strongly needed Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-05-23 21:31 -0700
                                                        Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-24 11:00 +0200
                                                        Re: switch/extension for see below strongly needed Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-05-24 04:15 -0700
                                                  Re: switch/extension for see below strongly needed James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-05-20 10:40 -0400
                                                    Re: switch/extension for see below strongly needed "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-20 16:52 -0700
                                                  Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-20 14:56 +0000
                                            Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-20 06:38 +0200
                                              Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-21 02:45 +0200
                                                Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-21 02:31 +0100
                                                Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-21 10:16 +0200
                                                  [OT] Genie bug and fix (was Re: switch/extension for see below strongly needed) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-22 04:48 +0200
                                                    Re: [OT] Genie bug and fix (was Re: switch/extension for see below strongly needed) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-22 05:02 +0200
                                                    Re: [OT] Genie bug and fix (was Re: switch/extension for see below strongly needed) Bart <bc@freeuk.com> - 2026-05-22 11:18 +0100
                                                      Re: [OT] Genie bug and fix (was Re: switch/extension for see below strongly needed) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-23 09:21 +0200
                                          Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-20 06:24 +0200
                                            Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-20 11:55 +0100
                                              Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-21 02:30 +0200
                                                Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-21 02:21 +0100
                                                  Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-20 18:51 -0700
                                                    Re: switch/extension for see below strongly needed gazelle@shell.xmission.com (Kenny McCormack) - 2026-05-21 11:46 +0000
                                                      Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-21 14:56 +0200
                                                  Re: switch/extension for see below strongly needed scott@slp53.sl.home (Scott Lurndal) - 2026-05-21 15:12 +0000
                                                    Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-21 16:47 +0100
                                                    Re: switch/extension for see below strongly needed Michael S <already5chosen@yahoo.com> - 2026-05-21 19:27 +0300
                                                      Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-21 20:03 +0200
                                                        Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-21 19:42 +0100
                                                    Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-21 19:46 +0200
                                                      Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-21 20:08 +0100
                                        Re: switch/extension for see below strongly needed "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-19 14:34 -0700
                                          Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-19 15:01 -0700
                                            Re: switch/extension for see below strongly needed "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-19 15:15 -0700
                                              Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-20 09:24 +0200
                                                Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-20 03:26 -0700
                              Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-19 13:29 +0200
                                Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-19 16:46 +0200
                              Re: switch/extension for see below strongly needed scott@slp53.sl.home (Scott Lurndal) - 2026-05-19 13:56 +0000
                              Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-19 14:27 -0700
                          Re: switch/extension for see below strongly needed James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-05-19 12:35 -0400
                    Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-18 11:57 +0100
                      Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-18 13:57 +0200
                        Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-18 14:18 +0100
                          Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-18 16:07 +0200
                          Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-18 14:12 -0700
                  Re: switch/extension for see below strongly needed Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-05-18 07:17 +0000
              Re: switch/extension for see below strongly needed Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-05-17 23:30 +0000
                Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-18 09:02 +0200
                  Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-18 09:38 +0200
                    Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-18 10:50 +0100
                  Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-18 10:00 +0200
                  Re: switch/extension for see below strongly needed "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-18 16:31 -0700
                    Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-19 09:18 +0200
                      Re: switch/extension for see below strongly needed David Brown <david.brown@hesbynett.no> - 2026-05-19 10:00 +0200
                        Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-19 10:34 +0200
                          Re: switch/extension for see below strongly needed "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-19 14:19 -0700
                            Re: switch/extension for see below strongly needed Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-20 04:09 +0200
              Re: switch/extension for see below strongly needed James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-05-19 11:43 -0400
          Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-18 01:22 +0000
            Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-18 11:23 +0100
              Re: switch/extension for see below strongly needed cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-18 11:07 +0000
                Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-18 14:10 +0200
                  Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-18 15:01 +0200
                    Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-18 14:33 +0100
                      Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-18 16:39 +0200
                        Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-18 16:12 +0100
                          Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-18 17:35 +0200
                      Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-18 16:59 +0200
                        Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-18 16:25 +0100
                          Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-18 17:50 +0200
                            Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-18 18:21 +0200
                        Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-18 17:29 +0200
                      Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-18 17:04 +0200
                        Re: switch/extension for see below strongly needed Bart <bc@freeuk.com> - 2026-05-18 16:31 +0100
                          Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-18 18:12 +0200
                          Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-18 18:24 +0200
                      Re: switch/extension for see below strongly needed Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-18 14:40 -0700
      Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-17 14:57 +0200
        Re: switch/extension for see below strongly needed fir <profesor.fir@gmail.com> - 2026-05-17 16:06 +0200
    Re: multipass Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-05-17 05:50 +0000
      Re: multipass Bart <bc@freeuk.com> - 2026-05-17 11:26 +0100
        Re: multipass David Brown <david.brown@hesbynett.no> - 2026-05-18 09:08 +0200
      Re: multipass Bonita Montero <Bonita.Montero@gmail.com> - 2026-05-17 17:31 +0200
      Re: multipass makendo <makendo@makendo.invalid> - 2026-05-24 01:14 +0800
        Re: multipass Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-05-27 01:05 +0000

Page 2 of 13 — ← Prev page 1 [2] 3 4 … 13  Next page →


#399165 — Re: Using "extra" blocks to declare local variables (Was: switch/extension for see below strongly needed)

Fromscott@slp53.sl.home (Scott Lurndal)
Date2026-05-19 14:04 +0000
SubjectRe: Using "extra" blocks to declare local variables (Was: switch/extension for see below strongly needed)
Message-ID<b6_OR.2336738$4wI6.573542@fx24.iad>
In reply to#399147
David Brown <david.brown@hesbynett.no> writes:
>On 19/05/2026 07:48, Kenny McCormack wrote:
>> In article <10ufgg4$2l9ge$1@dont-email.me>,
>> David Brown  <david.brown@hesbynett.no> wrote:
>> ...
>>>> I agree about style.  But AFAICS even in very early C there is block
>>>> structure and one can put variable declarations in the middle of
>>>> sequence, just at the cost of introducing extra blocks.  So C99
>>>> looks nicer as there is no need for extra blocks, but pre C99
>>>> already one could keep scopes tight and initialize variables in
>>>> declarations.
>>>
>>> Certainly you can do that.  But it quickly gets ugly and inconvenient if
>>> you have a lot of extra blocks.  It's fair enough if you have a block
>>> already, from a loop or conditional.
>> 
>> I have always liked this feature of C - that you can create an "extra"
>> block anywhere and then have locals declared there, like this:
>> 
>> ...
>> puts("This is regular code");
>> {
>>      int i = 10;
>>      ...
>> }
>> puts("More code here");
>> ...
>> 
>> This is useful if you are modifying code you didn't write and don't
>> understand, but you just want to add some new feature (and declare some
>> variables for your own use), without disturbing (i.e., conflicting with)
>> anything that is already there.  And, as noted, this works in all versions
>> of C, going back ...
>> 
>
>I agree it can sometimes be useful.  It is not often needed - especially 
>in C99 onwards - but sometimes it can be the neatest way to structure code.
>
>I think probably the most common situation where I create "extra" blocks 
>would be in switch cases.  It lets you pretend that "switch" is more 
>structured than it really is.

I often declare local variables within
a compound statement introduced by a do/while/for/case construct.

In pre or post C99 code, I do not create compound statements willy-nilly just
to hide a prior defined local variable with the same name (a maintenance
nightmare, to be sure) or to locate the declaration closer to the use
in a function.

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


#399343 — Re: Using "extra" blocks to declare local variables (Was: switch/extension for see below strongly needed)

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2026-05-22 23:44 -0700
SubjectRe: Using "extra" blocks to declare local variables (Was: switch/extension for see below strongly needed)
Message-ID<86cxymhbgt.fsf@linuxsc.com>
In reply to#399165
scott@slp53.sl.home (Scott Lurndal) writes:

> I often declare local variables within a compound statement
> introduced by a do/while/for/case construct.

I do this too, although I don't know if I would say often.
Probably closer to 50/50.  Also the same applies to if().

I commonly use the declaration syntax in for() statements to have
an iteration variable (or variables) local to the loop.

> In pre or post C99 code, I do not create compound statements
> willy-nilly just to hide a prior defined local variable with the
> same name (a maintenance nightmare, to be sure) or to locate the
> declaration closer to the use in a function.

I agree with both of these.  Very rarely I might introduce a
compound statement "out of the blue" not for either those reasons
but expressly to limit the scope of a variable in the midst of a
long and complicated function.  Especially because such cases are
rare, I like to flag them with double braces, something like

    {{  ULL carry = 0;
        for(...){
            ...    uses of carry
            ...    uses of carry
        }
        if(...)    uses of carry
        if(...)
    }}

(and yes, in case anyone is wondering, there are reasons why the
code in this case couldn't be abstracted into a sub-function).

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


#399133

Fromcross@spitfire.i.gajendra.net (Dan Cross)
Date2026-05-18 18:13 +0000
Message-ID<10ufkt3$aqd$1@reader1.panix.com>
In reply to#399130
In article <10uffq4$m4se$1@paganini.bofh.team>,
Waldek Hebisch <antispam@fricas.org> wrote:
>David Brown <david.brown@hesbynett.no> wrote:
>> 
>> Sure.  But in the C world, pre-C99 code is often written in a style with 
>> local variables all declared at the top of the function - after C99, it 
>> is common to declare them when you need them.  So as a C programmer, I 
>> see declaring local variables in one clump together as archaic.
>
>I agree about style.  But AFAICS even in very early C there is block
>structure and one can put variable declarations in the middle of
>sequence, just at the cost of introducing extra blocks. [snip]

Maybe.  But on projects based on older variants of C, it was
common as a matter of local policy to mandate that locals were
declared at the top of a function; this enabled readers to get
a sense of how much stack space was required at a glance.

Fortunately, those bad days old are _mostly_ gone.

	- Dan C.

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


#399134

Fromscott@slp53.sl.home (Scott Lurndal)
Date2026-05-18 18:37 +0000
Message-ID<O%IOR.260817$gO1.48843@fx14.iad>
In reply to#399133
cross@spitfire.i.gajendra.net (Dan Cross) writes:
>In article <10uffq4$m4se$1@paganini.bofh.team>,
>Waldek Hebisch <antispam@fricas.org> wrote:
>>David Brown <david.brown@hesbynett.no> wrote:
>>> 
>>> Sure.  But in the C world, pre-C99 code is often written in a style with 
>>> local variables all declared at the top of the function - after C99, it 
>>> is common to declare them when you need them.  So as a C programmer, I 
>>> see declaring local variables in one clump together as archaic.
>>
>>I agree about style.  But AFAICS even in very early C there is block
>>structure and one can put variable declarations in the middle of
>>sequence, just at the cost of introducing extra blocks. [snip]
>
>Maybe.  But on projects based on older variants of C, it was
>common as a matter of local policy to mandate that locals were
>declared at the top of a function; this enabled readers to get
>a sense of how much stack space was required at a glance.

That mandate also facilitated the use of the vi '[['
sequence to easily move to the local declarations,
and '``' would return to the previous location.

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


#399146 — You are not allowed to use "the S word" in this ng. (Was: switch/extension for see below strongly needed)

Fromgazelle@shell.xmission.com (Kenny McCormack)
Date2026-05-19 05:49 +0000
SubjectYou are not allowed to use "the S word" in this ng. (Was: switch/extension for see below strongly needed)
Message-ID<10ugtll$298li$2@news.xmission.com>
In reply to#399133
In article <10ufkt3$aqd$1@reader1.panix.com>,
Dan Cross <cross@spitfire.i.gajendra.net> wrote:
...
>Maybe.  But on projects based on older variants of C, it was
>common as a matter of local policy to mandate that locals were
>declared at the top of a function; this enabled readers to get
>a sense of how much stack space was required at a glance.

Oh oh.  You said "The S word".  Leader Keith is not going to like this.

-- 
I love the poorly educated.

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


#399132

FromBart <bc@freeuk.com>
Date2026-05-18 18:35 +0100
Message-ID<10ufik8$2kv1j$1@dont-email.me>
In reply to#399104
On 18/05/2026 09:35, David Brown wrote:
> On 18/05/2026 09:22, Janis Papanagnou wrote:
>> On 2026-05-18 08:56, David Brown wrote:
>>> [...]
>>>
>>> Much better, IMHO, is to use a language that lets you mix 
>>> declarations and statements as needed. 
>>
>> Indeed. But not "mixing" as a value per se, but to keep declarations
>> locally is a good thing, IMO.
>>
> 
> Yes - it is not the mixing itself that is good, it is what it allows. 
> You get to keep your scopes small, you don't need to declare variables 
> until you have an initial value for them (who cares if reading an 
> uninitialised variable is UB if you never have them!), and you can often 
> declare your variables as const.  That means it's easy to know what the 
> variable holds because it is only set once, and never changed.
> 
>>> I see declaring your local variables in a list at the top of a 
>>> function - or, far worse, at the bottom - as archaic style.
>>
>> Well, "archaic" expresses a time-related qualification. But even in
>> earlier times we saw, depending on the actual programming language,
>> both styles existing.
> 
> Sure.  But in the C world, pre-C99 code is often written in a style with 
> local variables all declared at the top of the function - after C99, it 
> is common to declare them when you need them.  So as a C programmer, I 
> see declaring local variables in one clump together as archaic.

I hate dealing with code that just declares variables higgledy-piggledy 
all over the place; it is so lazy. I'm not into block scopes either.

I /like/ to have them all in one place for easy reference. Then the code 
itself will have less clutter.

There are several places in C where it is common to declare stuff in one 
place:

* In parameter lists (at least we always have that, except when 
parameter 'x' is used, and you see 'x' in the body, your practice means 
I have to scan backwards from that point to see if it is parameter 'x', 
or some other 'x' in a nested scope that shadows it).

* #includes
* Imported variables
* Imported functions
* Forward function declarations

Imagine how annoying it would be if any of those last were used inside a 
block within a function. Well, that's how annoying local declarations 
mixed with code are.

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


#399135

FromDavid Brown <david.brown@hesbynett.no>
Date2026-05-18 21:24 +0200
Message-ID<10ufp1j$2nsig$1@dont-email.me>
In reply to#399132
On 18/05/2026 19:35, Bart wrote:
> On 18/05/2026 09:35, David Brown wrote:
>> On 18/05/2026 09:22, Janis Papanagnou wrote:
>>> On 2026-05-18 08:56, David Brown wrote:
>>>> [...]
>>>>
>>>> Much better, IMHO, is to use a language that lets you mix 
>>>> declarations and statements as needed. 
>>>
>>> Indeed. But not "mixing" as a value per se, but to keep declarations
>>> locally is a good thing, IMO.
>>>
>>
>> Yes - it is not the mixing itself that is good, it is what it allows. 
>> You get to keep your scopes small, you don't need to declare variables 
>> until you have an initial value for them (who cares if reading an 
>> uninitialised variable is UB if you never have them!), and you can 
>> often declare your variables as const.  That means it's easy to know 
>> what the variable holds because it is only set once, and never changed.
>>
>>>> I see declaring your local variables in a list at the top of a 
>>>> function - or, far worse, at the bottom - as archaic style.
>>>
>>> Well, "archaic" expresses a time-related qualification. But even in
>>> earlier times we saw, depending on the actual programming language,
>>> both styles existing.
>>
>> Sure.  But in the C world, pre-C99 code is often written in a style 
>> with local variables all declared at the top of the function - after 
>> C99, it is common to declare them when you need them.  So as a C 
>> programmer, I see declaring local variables in one clump together as 
>> archaic.
> 
> I hate dealing with code that just declares variables higgledy-piggledy 
> all over the place; it is so lazy. I'm not into block scopes either.

Um, okay.  You seem to define a lot of your programming life around 
hating things a large proportion of programmers consider good practice. 
But you are free to have your preferences.

> 
> I /like/ to have them all in one place for easy reference. Then the code 
> itself will have less clutter.
> 
> There are several places in C where it is common to declare stuff in one 
> place:
> 
> * In parameter lists (at least we always have that, except when 
> parameter 'x' is used, and you see 'x' in the body, your practice means 
> I have to scan backwards from that point to see if it is parameter 'x', 
> or some other 'x' in a nested scope that shadows it).

That's a typical (for you) strawman argument.  I don't know of anyone 
who considers it good practice to shadow function parameters with local 
variables.

> 
> * #includes

It is common in most languages to use includes, imports, uses, or 
whatever "module import" mechanism the language supports, near the top 
of source files.

> * Imported variables
> * Imported functions

I'm not sure what you are trying to say here.  People tend to group 
things that logically hang together - though there is often more than 
one way to do so.


> * Forward function declarations
> 
> Imagine how annoying it would be if any of those last were used inside a 
> block within a function. Well, that's how annoying local declarations 
> mixed with code are.
> 

Some people do like to declare imported (i.e., "extern") functions or 
data within the functions that use them.  I don't, but different people 
have different preferences.

I appreciate that /you/ find declarations after statements to be 
annoying - yet you sing the praises of your own language because it 
allows declarations to occur anywhere mixed with statements, including 
after their usage.  I suppose it is annoying when someone else does it, 
yet innovative and god's gift to the programming world when /you/ do it.

People who mix declarations and statements in their C programming do so 
knowing full well that they could put their local variable declarations 
all at the top of the function - but they feel that mixing them gives 
the best quality code, with the least risk of mistakes and the clearest, 
most understandable and most maintainable results.

Or perhaps they only do so specifically to annoy you.

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


#399136

FromBart <bc@freeuk.com>
Date2026-05-18 21:48 +0100
Message-ID<10uftvh$2p4eo$1@dont-email.me>
In reply to#399135
On 18/05/2026 20:24, David Brown wrote:
> On 18/05/2026 19:35, Bart wrote:

>> I hate dealing with code that just declares variables higgledy- 
>> piggledy all over the place; it is so lazy. I'm not into block scopes 
>> either.
> 
> Um, okay.  You seem to define a lot of your programming life around 
> hating things a large proportion of programmers consider good practice. 
> But you are free to have your preferences.

I have to deal with C quite a lot.

> People who mix declarations and statements in their C programming do so 
> knowing full well that they could put their local variable declarations 
> all at the top of the function - but they feel that mixing them gives 
> the best quality code, with the least risk of mistakes and the clearest, 
> most understandable and most maintainable results.
> 
> Or perhaps they only do so specifically to annoy you.

Every time I do a survey of C codebases, I tend to get about the same 
set of results:

* On average functions have only around three local variables

* 80% of all functions have 4 locals or fewer

I don't find such stats a compelling reason for block scopes, or why 
people want to hide a function's handful of locals within the executable 
code.

(Stats vary but for STB_IMAGE.H, a library I use, and tested after I 
wrote the above, they are:

  Number of Functions:     207
  Average Locals:            3.4
  Funcs with <= 4 Locals:  170 (82%)
  Most common # of locals:   1  (57/207; next most common is 0: 56/207)
)


 > I appreciate that /you/ find declarations after statements to be
 > annoying - yet you sing the praises of your own language because it
 > allows declarations to occur anywhere mixed with statements, including
 > after their usage.  I suppose it is annoying when someone else does it,
 > yet innovative and god's gift to the programming world when /you/ do it.

Yes I allow them anywhere, but 99% of the time in a finished program 
they are at the top of a function. Mostly they are used for temporary code.

(If other people were to use my language, they may do things 
differently. I would still find that annoying if I had to deal with it.

Remember that I don't have block scopes, so if I see a declaration in 
the middle, I know that applies function-wide.

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


#399574

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2026-05-31 17:00 -0700
Message-ID<86cxybdt94.fsf@linuxsc.com>
In reply to#399136
Bart <bc@freeuk.com> writes:

> Every time I do a survey of C codebases, I tend to get about the
> same set of results:
>
> * On average functions have only around three local variables
>
> * 80% of all functions have 4 locals or fewer

Here are some statistics from a codebase for a C library:

  Average number of locals per function:  just over 2

  Fraction of functions with 4 locals or fewer:  just over 85%

What conclusions should we draw from these statistics?

> I don't find such stats a compelling reason for block scopes,

As most people know, a problem with averages is that they rarely
tell the whole story.  Despite the similarity of the statistics
shown above with the ones you gave, code in the library codebase
has locals declared in inner blocks, and locals declared in the
outermost block but after some number of executable statements,
and also locals declared in other nested scopes.  In no case were
any of these choices made from indifference:  the code shows a
clear preference for declaring locals in the outermost block, and
at the top of that block before any executable code.  In every
instance that doesn't follow that rule there was a particular
motivation for adopting the choice that was made.  The idea that
such averages make a good argument for never accepting locals
other than at the top of the outermost block just doesn't hold
water.

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


#399138

FromKeith Thompson <Keith.S.Thompson+u@gmail.com>
Date2026-05-18 14:23 -0700
Message-ID<10ufvvn$2q07q$2@kst.eternal-september.org>
In reply to#399132
Bart <bc@freeuk.com> writes:
[...]
> I hate dealing with code that just declares variables
> higgledy-piggledy all over the place; it is so lazy. I'm not into
> block scopes either.

I would probably hate such code myself.  Nobody advocates just
declarating variables "higgledy-piggledy all over the place".

Something that is widely considered good programming style is
to define variables close to where they're used.  In a medium to
large sized function, that can result in something that you might
perceive as "higgledy-piggled", but it's not.  I'd explain further
if I thought you'd be interested.

Yes, it's less of an issue if functions are short.

> I /like/ to have them all in one place for easy reference. Then the
> code itself will have less clutter.

I acknowledge your preference.  Others do not share it.

[...]

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

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


#399148

FromLawrence D’Oliveiro <ldo@nz.invalid>
Date2026-05-19 06:58 +0000
Message-ID<10uh1lv$32nli$1@dont-email.me>
In reply to#399132
On Mon, 18 May 2026 18:35:04 +0100, Bart wrote:

> I hate dealing with code that just declares variables
> higgledy-piggledy all over the place; it is so lazy. I'm not into
> block scopes either.

Tight control over scope reduces the chances of unexpected
interactions across different parts of the code.

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


#399155

FromBart <bc@freeuk.com>
Date2026-05-19 11:55 +0100
Message-ID<10uhfim$36a89$2@dont-email.me>
In reply to#399148
On 19/05/2026 07:58, Lawrence D’Oliveiro wrote:
> On Mon, 18 May 2026 18:35:04 +0100, Bart wrote:
> 
>> I hate dealing with code that just declares variables
>> higgledy-piggledy all over the place; it is so lazy. I'm not into
>> block scopes either.
> 
> Tight control over scope reduces the chances of unexpected
> interactions across different parts of the code.

At the same time, it makes it harder to see what interactions there 
might be, because you don't know whether the 'x' appearing here is the 
same one used earlier and/or the one used later.

You need to very carefully trace the declaration for each instance.

And also (this is what I hate), you have a bloody great declaration 
right in the middle of what would have been your nice clean code.

There is also the odd way that scopes work:

     int a;             // a1
     ....               // a1 in scope
     {
        print(a);       // a1 in scope
        double a;       // a2
        print(a);       // a2 in scope
     }
     ....               // a1 in scope

They don't need to be delimited by {...}; here that block has a1 in 
first half and a2 in second half, but both are 'a'.

Here:
    ....
    double b = a, a;
    ....

'b' is initialised from a1, then it declares a2, however since both a1 
and a2 are called 'a', it is a touch confusing!

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


#399156

FromRichard Harnden <richard.nospam@gmail.invalid>
Date2026-05-19 12:15 +0100
Message-ID<10uhgpd$36vg4$1@dont-email.me>
In reply to#399155
On 19/05/2026 11:55, Bart wrote:
> On 19/05/2026 07:58, Lawrence D’Oliveiro wrote:
>> On Mon, 18 May 2026 18:35:04 +0100, Bart wrote:
>>
>>> I hate dealing with code that just declares variables
>>> higgledy-piggledy all over the place; it is so lazy. I'm not into
>>> block scopes either.
>>
>> Tight control over scope reduces the chances of unexpected
>> interactions across different parts of the code.
> 
> At the same time, it makes it harder to see what interactions there 
> might be, because you don't know whether the 'x' appearing here is the 
> same one used earlier and/or the one used later.
> 
> You need to very carefully trace the declaration for each instance.
> 
> And also (this is what I hate), you have a bloody great declaration 
> right in the middle of what would have been your nice clean code.
> 
> There is also the odd way that scopes work:
> 
>      int a;             // a1
>      ....               // a1 in scope
>      {
>         print(a);       // a1 in scope
>         double a;       // a2
>         print(a);       // a2 in scope
>      }
>      ....               // a1 in scope
> 
> They don't need to be delimited by {...}; here that block has a1 in 
> first half and a2 in second half, but both are 'a'.

Yes they do.  How else does 'a' stop being a2 and revert to a1?

> 
> Here:
>     ....
>     double b = a, a;
>     ....
> 
> 'b' is initialised from a1, then it declares a2, however since both a1 
> and a2 are called 'a', it is a touch confusing!

So, don't do that.

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


#399158

FromBart <bc@freeuk.com>
Date2026-05-19 12:48 +0100
Message-ID<10uhilu$37ktg$1@dont-email.me>
In reply to#399156
On 19/05/2026 12:15, Richard Harnden wrote:
> On 19/05/2026 11:55, Bart wrote:
>> On 19/05/2026 07:58, Lawrence D’Oliveiro wrote:
>>> On Mon, 18 May 2026 18:35:04 +0100, Bart wrote:
>>>
>>>> I hate dealing with code that just declares variables
>>>> higgledy-piggledy all over the place; it is so lazy. I'm not into
>>>> block scopes either.
>>>
>>> Tight control over scope reduces the chances of unexpected
>>> interactions across different parts of the code.
>>
>> At the same time, it makes it harder to see what interactions there 
>> might be, because you don't know whether the 'x' appearing here is the 
>> same one used earlier and/or the one used later.
>>
>> You need to very carefully trace the declaration for each instance.
>>
>> And also (this is what I hate), you have a bloody great declaration 
>> right in the middle of what would have been your nice clean code.
>>
>> There is also the odd way that scopes work:
>>
>>      int a;             // a1
>>      ....               // a1 in scope
>>      {
>>         print(a);       // a1 in scope
>>         double a;       // a2
>>         print(a);       // a2 in scope
>>      }
>>      ....               // a1 in scope
>>
>> They don't need to be delimited by {...}; here that block has a1 in 
>> first half and a2 in second half, but both are 'a'.
> 
> Yes they do.  How else does 'a' stop being a2 and revert to a1?

a1 turned into a2 without crossing '{'.

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


#399160

FromDavid Brown <david.brown@hesbynett.no>
Date2026-05-19 14:23 +0200
Message-ID<10uhknl$32goi$1@dont-email.me>
In reply to#399158
On 19/05/2026 13:48, Bart wrote:
> On 19/05/2026 12:15, Richard Harnden wrote:
>> On 19/05/2026 11:55, Bart wrote:
>>> On 19/05/2026 07:58, Lawrence D’Oliveiro wrote:
>>>> On Mon, 18 May 2026 18:35:04 +0100, Bart wrote:
>>>>
>>>>> I hate dealing with code that just declares variables
>>>>> higgledy-piggledy all over the place; it is so lazy. I'm not into
>>>>> block scopes either.
>>>>
>>>> Tight control over scope reduces the chances of unexpected
>>>> interactions across different parts of the code.
>>>
>>> At the same time, it makes it harder to see what interactions there 
>>> might be, because you don't know whether the 'x' appearing here is 
>>> the same one used earlier and/or the one used later.
>>>
>>> You need to very carefully trace the declaration for each instance.
>>>
>>> And also (this is what I hate), you have a bloody great declaration 
>>> right in the middle of what would have been your nice clean code.
>>>
>>> There is also the odd way that scopes work:
>>>
>>>      int a;             // a1
>>>      ....               // a1 in scope
>>>      {
>>>         print(a);       // a1 in scope
>>>         double a;       // a2
>>>         print(a);       // a2 in scope
>>>      }
>>>      ....               // a1 in scope
>>>
>>> They don't need to be delimited by {...}; here that block has a1 in 
>>> first half and a2 in second half, but both are 'a'.
>>
>> Yes they do.  How else does 'a' stop being a2 and revert to a1?
> 
> a1 turned into a2 without crossing '{'.
> 

It did so at the new declaration of "a".  How could that possibly be 
surprising or "odd" ?

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


#399161

FromBart <bc@freeuk.com>
Date2026-05-19 14:08 +0100
Message-ID<10uhnc2$38l18$1@dont-email.me>
In reply to#399160
On 19/05/2026 13:23, David Brown wrote:
> On 19/05/2026 13:48, Bart wrote:
>> On 19/05/2026 12:15, Richard Harnden wrote:
>>> On 19/05/2026 11:55, Bart wrote:
>>>> On 19/05/2026 07:58, Lawrence D’Oliveiro wrote:
>>>>> On Mon, 18 May 2026 18:35:04 +0100, Bart wrote:
>>>>>
>>>>>> I hate dealing with code that just declares variables
>>>>>> higgledy-piggledy all over the place; it is so lazy. I'm not into
>>>>>> block scopes either.
>>>>>
>>>>> Tight control over scope reduces the chances of unexpected
>>>>> interactions across different parts of the code.
>>>>
>>>> At the same time, it makes it harder to see what interactions there 
>>>> might be, because you don't know whether the 'x' appearing here is 
>>>> the same one used earlier and/or the one used later.
>>>>
>>>> You need to very carefully trace the declaration for each instance.
>>>>
>>>> And also (this is what I hate), you have a bloody great declaration 
>>>> right in the middle of what would have been your nice clean code.
>>>>
>>>> There is also the odd way that scopes work:
>>>>
>>>>      int a;             // a1
>>>>      ....               // a1 in scope
>>>>      {
>>>>         print(a);       // a1 in scope
>>>>         double a;       // a2
>>>>         print(a);       // a2 in scope
>>>>      }
>>>>      ....               // a1 in scope
>>>>
>>>> They don't need to be delimited by {...}; here that block has a1 in 
>>>> first half and a2 in second half, but both are 'a'.
>>>
>>> Yes they do.  How else does 'a' stop being a2 and revert to a1?
>>
>> a1 turned into a2 without crossing '{'.
>>
> 
> It did so at the new declaration of "a".  How could that possibly be 
> surprising or "odd" ?
> 

How could it possibly not be?!

{...} is a block in C, and C has block scopes. Given that, people might 
expect a scope to be delimited by the enclosing spaces.

But names don't come into existence until declared, which can be in the 
middle of a block. Until then, the outer version of 'a' is still in scope.

The point at each that happens, in a busy section of code with lots of 
declarations, can be unclear, with overlaps:

    double a;
    ....       // a2 b1 c1
    double b;
    ....       // a2 b2 c1
    double c;
    ....       // a2 b2 c2

These all shadow a, b, c in an outer scope, but at different times.

The simplest scoping rule in C is for labels: they have function-wide 
scope, regardless of block nesting label.

That would almost be as simple as how my own scopes work, except C just 
has to still be quirky:

    double c; c: goto c;

(Labels of course have their own namespace, for some obscure reason. I'm 
sure 99% of C programmers don't know that.)

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


#399163

FromDavid Brown <david.brown@hesbynett.no>
Date2026-05-19 15:40 +0200
Message-ID<10uhp7t$39olh$1@dont-email.me>
In reply to#399161
On 19/05/2026 15:08, Bart wrote:
> On 19/05/2026 13:23, David Brown wrote:
>> On 19/05/2026 13:48, Bart wrote:
>>> On 19/05/2026 12:15, Richard Harnden wrote:
>>>> On 19/05/2026 11:55, Bart wrote:
>>>>> On 19/05/2026 07:58, Lawrence D’Oliveiro wrote:
>>>>>> On Mon, 18 May 2026 18:35:04 +0100, Bart wrote:
>>>>>>
>>>>>>> I hate dealing with code that just declares variables
>>>>>>> higgledy-piggledy all over the place; it is so lazy. I'm not into
>>>>>>> block scopes either.
>>>>>>
>>>>>> Tight control over scope reduces the chances of unexpected
>>>>>> interactions across different parts of the code.
>>>>>
>>>>> At the same time, it makes it harder to see what interactions there 
>>>>> might be, because you don't know whether the 'x' appearing here is 
>>>>> the same one used earlier and/or the one used later.
>>>>>
>>>>> You need to very carefully trace the declaration for each instance.
>>>>>
>>>>> And also (this is what I hate), you have a bloody great declaration 
>>>>> right in the middle of what would have been your nice clean code.
>>>>>
>>>>> There is also the odd way that scopes work:
>>>>>
>>>>>      int a;             // a1
>>>>>      ....               // a1 in scope
>>>>>      {
>>>>>         print(a);       // a1 in scope
>>>>>         double a;       // a2
>>>>>         print(a);       // a2 in scope
>>>>>      }
>>>>>      ....               // a1 in scope
>>>>>
>>>>> They don't need to be delimited by {...}; here that block has a1 in 
>>>>> first half and a2 in second half, but both are 'a'.
>>>>
>>>> Yes they do.  How else does 'a' stop being a2 and revert to a1?
>>>
>>> a1 turned into a2 without crossing '{'.
>>>
>>
>> It did so at the new declaration of "a".  How could that possibly be 
>> surprising or "odd" ?
>>
> 
> How could it possibly not be?!
> 
> {...} is a block in C, and C has block scopes. Given that, people might 
> expect a scope to be delimited by the enclosing spaces.

People expect scopes to begin with a declaration, and end at the end of 
the block (or file, for file-scope identifiers).  This is the normal 
handling of scoping in most imperative programming languages.  There are 
some languages (such as Python) where scopes begin when a variable is 
first assigned, and continue to the end of the function rather than the 
block.  And declarative programming languages may do things differently 
- they do many things differently.

Languages may differ in the details - given "int a = foo(a);", for 
example, the scope of the new "a" in C begins after "int a" - in some 
languages, it may not begin until the end of the semicolon.  But that's 
a small detail, rarely relevant in real code.  (For the record, I'd have 
preferred if the scope of variables in C did not begin until the end of 
the declaration / definition.)

Can you give me an example of a real-world programming language in which 
the scope of a local variable begins at the start of the enclosing 
block, rather than at its declaration / definition?

Perhaps you are mixing up "scope" and "lifetime" ?  These are not the 
same things.

> 
> But names don't come into existence until declared, which can be in the 
> middle of a block. Until then, the outer version of 'a' is still in scope.
> 

Yes.  Scope is all about the names.

> The point at each that happens, in a busy section of code with lots of 
> declarations, can be unclear, with overlaps:
> 
>     double a;
>     ....       // a2 b1 c1
>     double b;
>     ....       // a2 b2 c1
>     double c;
>     ....       // a2 b2 c2
> 
> These all shadow a, b, c in an outer scope, but at different times.

Yes.  (Although this is again a strawman argument - people don't 
normally write code that shadows outer scope variables.)

> 
> The simplest scoping rule in C is for labels: they have function-wide 
> scope, regardless of block nesting label.
> 

The rule for C labels exists because you have to be able to jump 
backwards and forwards for "goto" to be of much use.  In C programming, 
labels (excluding case labels) are rarely used except sometimes for 
error handling.  I don't think I've written "goto" in C more than a 
couple of times in my programming career.

C labels are unstructured.  This is not a good thing in a programming 
language - it is an unfortunate necessary evil.  Other identifiers have 
clearer and simpler scoping - scope starts with the declaration, and 
ends with the end of the enclosing block.

> That would almost be as simple as how my own scopes work, except C just 
> has to still be quirky:
> 
>     double c; c: goto c;
> 
> (Labels of course have their own namespace, for some obscure reason. I'm 
> sure 99% of C programmers don't know that.)

Since we are pulling numbers out of the air, 99% of C programmers don't 
care.  If any C programmer writes code where this is important, because 
they use the same identifier for a variable and a goto label, they 
should not be programming.

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


#399166

FromJanis Papanagnou <janis_papanagnou+ng@hotmail.com>
Date2026-05-19 16:41 +0200
Message-ID<10uhsqv$jvhi$7@dont-email.me>
In reply to#399163
On 2026-05-19 15:40, David Brown wrote:
> [...]
> 
> Can you give me an example of a real-world programming language in which 
> the scope of a local variable begins at the start of the enclosing 
> block, rather than at its declaration / definition?

If I'm asking Google it tells me that Python and Javascript (when
using 'var') would be two prominent examples.

Janis

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


#399168

FromDavid Brown <david.brown@hesbynett.no>
Date2026-05-19 17:07 +0200
Message-ID<10uhub0$395oi$1@dont-email.me>
In reply to#399166
On 19/05/2026 16:41, Janis Papanagnou wrote:
> On 2026-05-19 15:40, David Brown wrote:
>> [...]
>>
>> Can you give me an example of a real-world programming language in 
>> which the scope of a local variable begins at the start of the 
>> enclosing block, rather than at its declaration / definition?
> 
> If I'm asking Google it tells me that Python and Javascript (when
> using 'var') would be two prominent examples.
> 
> Janis
> 

I don't know about Javascript, but it's wrong about Python.

def foo() :
	print(a)
	a = 1
	print(a)

"a" is not in scope until the line "a = 1".  Try it and see.

It is possible that "a" blocks access to a global "a" before it is 
declared - since programmers rarely intentionally shadow other 
variables, and even more rarely try to access variables before they are 
defined, it's not a situation that is going to turn up in real code. 
Such subtle details are best checked in a Python newsgroup.

Note also that Python doesn't really have a concept of declaring a 
variable.  You initialise a reference to an object, you don't declare a 
variable as such.  (So "a = 1" here creates a constant integer object 
with the value 1 on the heap, or increases a reference count to an 
existing such object, and creates "a" as an identifier that references 
that object.  "a" is not a variable in the sense used in compiled 
imperative languages.)

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


#399169

FromJanis Papanagnou <janis_papanagnou+ng@hotmail.com>
Date2026-05-19 17:23 +0200
Message-ID<10uhva9$jvhi$9@dont-email.me>
In reply to#399168
On 2026-05-19 17:07, David Brown wrote:
> On 19/05/2026 16:41, Janis Papanagnou wrote:
>> On 2026-05-19 15:40, David Brown wrote:
>>> [...]
>>>
>>> Can you give me an example of a real-world programming language in 
>>> which the scope of a local variable begins at the start of the 
>>> enclosing block, rather than at its declaration / definition?
>>
>> If I'm asking Google it tells me that Python and Javascript (when
>> using 'var') would be two prominent examples.
> 
> I don't know about Javascript,

I did JS programming but never tried to put the declaration behind
the point of use of the declared items.

I mean that is the whole point; even if some language (for whatever
reason) would allow that, why should a sane programmer make use of
such obfuscation!

> but it's wrong about Python.

I don't know the details of and also don't program in python.

> 
> def foo() :
>      print(a)
>      a = 1
>      print(a)
> 
> "a" is not in scope until the line "a = 1".  Try it and see.

$ python
ksh93: python: not found

I trust your words. :-)

> [snip]

(I was just quoting search results. Never mind.)

Janis

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


Page 2 of 13 — ← Prev page 1 [2] 3 4 … 13  Next page →

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


csiph-web