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


Groups > comp.lang.c > #130802

Re: Global variables

From David Brown <david.brown@hesbynett.no>
Newsgroups comp.lang.c
Subject Re: Global variables
Date 2018-05-19 17:22 +0200
Organization A noiseless patient Spider
Message-ID <pdpfgn$2q2$1@dont-email.me> (permalink)
References (17 earlier) <pcng2e$i93$1@dont-email.me> <65JHC.109059$eg.30545@fx43.am4> <pcntds$df1$1@dont-email.me> <fl9ugkFj48lU1@mid.individual.net> <kfn4lj4jpl6.fsf@x-alumni2.alumni.caltech.edu>

Show all headers | View raw


On 19/05/18 05:23, Tim Rentsch wrote:
> Ian Collins <ian-news@hotmail.com> writes:
> 
>> On 05/07/2018 09:51 AM, David Brown wrote:
>>
>>> On 06/05/18 21:55, bartc wrote:
>>>
>>>> On 06/05/2018 19:03, David Brown wrote:
>>>>
>>>>> On 06/05/18 15:07, bartc wrote:
>>>>
>>>> [Allowing () parameter lists]
>>>>
>>>>> Another mistake from the programmer, not the language.
>>>>
>>>> In my opinion it is a language mistake.  If such a feature is genuinely
>>>> needed from time to time, use (flex) for that, and perhaps change the
>>>> meaning of () to be synonymous with (void).
>>>
>>> For C, backwards compatibility is key - so the meaning of "foo()" cannot
>>> be changed to "foo(void)", as it is in C++.  And C /does/ have a syntax
>>> for declaring variadic functions, using "...".  So "foo()" is never
>>> necessary, or even useful, as far as I can see, in C89 or newer code.
>>>
>>> But because it /was/ necessary before, and exists in useful C source
>>> code, it has to be supported by current compilers.
>>
>> It could be dropped and supported by new compilers in C < whatever
>> standard dropped it mode.  In my opinion it should be long gone!
> 
> A better idea is to add a standard #pragma that enables the new
> behavior desired.  Old code keeps working, each team can choose
> the option (or options plural) that better suits their needs, and
> no team or project becomes a second-class citizen in the larger
> community.
> 

That is good for keeping backwards compatibility, but is not as good for 
encouraging new, better behaviour.  People have a tendency to continue 
using old coding styles and techniques unless forced to think about 
something new and better.  If compilers were to reject code with "foo()" 
declarations, it would require people to change - you would either have 
to specifically add "this is old code" flags or pragmas, or fix the code 
to use proper prototypes.  That would greatly speed the process of 
getting ride of the old style and having all C code written with 
prototypes.  The cost, obviously, is that some code that compiled 
warning and error free would no longer compile without additional effort.

In my opinion, non-prototype function declarations have been marked 
obsolete for long enough - nearly 30 years.  It is reasonable to say 
that they are no longer wanted.

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


Thread

Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-01 11:00 -0700
  Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-01 19:26 +0100
    Re: The case AGAINST C supercat@casperkitty.com - 2018-05-01 11:40 -0700
    Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-01 12:53 -0700
      Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-01 22:03 +0100
        Re: The case AGAINST C Ian Collins <ian-news@hotmail.com> - 2018-05-02 09:10 +1200
          Re: The case AGAINST C supercat@casperkitty.com - 2018-05-01 14:21 -0700
            Re: The case AGAINST C Ian Collins <ian-news@hotmail.com> - 2018-05-02 09:26 +1200
              Re: The case AGAINST C supercat@casperkitty.com - 2018-05-01 15:23 -0700
            Re: The case AGAINST C scott@slp53.sl.home (Scott Lurndal) - 2018-05-02 14:07 +0000
              Re: The case AGAINST C Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-05-03 06:28 +0000
          Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-01 23:03 +0100
            Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-02 04:52 -0700
              Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-02 05:12 -0700
              Re: The case AGAINST C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-05-02 05:34 -0700
            Re: The case AGAINST C scott@slp53.sl.home (Scott Lurndal) - 2018-05-02 14:08 +0000
              Re: The case AGAINST C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-05-02 07:39 -0700
              Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-02 17:13 +0100
                Re: The case AGAINST C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-05-02 11:01 -0700
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-02 21:51 +0100
                Re: The case AGAINST C Ian Collins <ian-news@hotmail.com> - 2018-05-03 08:52 +1200
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-02 22:42 +0100
                Re: The case AGAINST C Ian Collins <ian-news@hotmail.com> - 2018-05-03 09:57 +1200
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-02 23:22 +0100
                Re: The case AGAINST C Ian Collins <ian-news@hotmail.com> - 2018-05-03 10:29 +1200
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-03 00:14 +0100
                Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-03 03:59 -0700
                Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-03 04:15 -0700
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-03 12:50 +0100
                Re: The case AGAINST C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-05-03 13:36 -0700
                Of course I get it... (Was: The case AGAINST C) gazelle@shell.xmission.com (Kenny McCormack) - 2018-05-03 08:44 +0000
                Re: The case AGAINST C Dan Purgert <dan@djph.net> - 2018-05-03 12:42 +0000
                Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-03 05:52 -0700
                Re: The case AGAINST C Dan Purgert <dan@djph.net> - 2018-05-03 12:56 +0000
                Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-03 05:58 -0700
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-03 14:36 +0100
                Re: The case AGAINST C already5chosen@yahoo.com - 2018-05-03 13:27 -0700
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-03 22:43 +0100
                Re: The case AGAINST C already5chosen@yahoo.com - 2018-05-03 15:17 -0700
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-04 00:50 +0100
                Re: The case AGAINST C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-05-03 15:41 -0700
                Re: The case AGAINST C David Brown <david.brown@hesbynett.no> - 2018-05-04 11:36 +0200
                Re: The case AGAINST C supercat@casperkitty.com - 2018-05-04 08:52 -0700
                Re: The case AGAINST C scott@slp53.sl.home (Scott Lurndal) - 2018-05-04 17:28 +0000
                Re: The case AGAINST C supercat@casperkitty.com - 2018-05-04 12:06 -0700
                Re: The case AGAINST C David Brown <david.brown@hesbynett.no> - 2018-05-05 18:45 +0200
                Re: The case AGAINST C scott@slp53.sl.home (Scott Lurndal) - 2018-05-06 18:43 +0000
                Re: The case AGAINST C David Brown <david.brown@hesbynett.no> - 2018-05-06 23:35 +0200
                Re: The case AGAINST C scott@slp53.sl.home (Scott Lurndal) - 2018-05-07 13:23 +0000
                Re: The case AGAINST C Steve Carroll <frelwizzen@gmail.com> - 2018-05-07 06:30 -0700
                Re: The case AGAINST C David Brown <david.brown@hesbynett.no> - 2018-05-07 16:25 +0200
                Re: The case AGAINST C Steve Carroll <frelwizzen@gmail.com> - 2018-05-07 07:32 -0700
                Re: The case AGAINST C Keith Thompson <kst-u@mib.org> - 2018-05-04 09:09 -0700
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-04 18:12 +0100
                Global variables bartc <bc@freeuk.com> - 2018-05-06 14:07 +0100
                Re: Global variables David Brown <david.brown@hesbynett.no> - 2018-05-06 20:03 +0200
                Re: Global variables Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2018-05-06 15:21 -0400
                Re: Global variables Keith Thompson <kst-u@mib.org> - 2018-05-06 13:07 -0700
                Re: Global variables Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2018-05-06 16:13 -0400
                Re: Global variables David Brown <david.brown@hesbynett.no> - 2018-05-06 23:39 +0200
                Re: Global variables Richard Damon <Richard@Damon-Family.org> - 2018-05-06 17:50 -0400
                Re: Global variables David Brown <david.brown@hesbynett.no> - 2018-05-06 23:57 +0200
                Re: Global variables Richard Damon <Richard@Damon-Family.org> - 2018-05-06 19:56 -0400
                Re: Global variables Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-05-07 03:21 +0100
                Re: Global variables David Brown <david.brown@hesbynett.no> - 2018-05-07 09:09 +0200
                Re: Global variables Keith Thompson <kst-u@mib.org> - 2018-05-07 08:49 -0700
                Re: Global variables bartc <bc@freeuk.com> - 2018-05-06 20:55 +0100
                Re: Global variables David Brown <david.brown@hesbynett.no> - 2018-05-06 23:51 +0200
                Re: Global variables Keith Thompson <kst-u@mib.org> - 2018-05-06 15:40 -0700
                Re: Global variables bartc <bc@freeuk.com> - 2018-05-06 23:54 +0100
                Re: Global variables Ian Collins <ian-news@hotmail.com> - 2018-05-07 15:12 +1200
                Re: Global variables David Brown <david.brown@hesbynett.no> - 2018-05-07 09:03 +0200
                Re: Global variables Tim Rentsch <txr@alumni.caltech.edu> - 2018-05-18 20:23 -0700
                Re: Global variables Steve Carroll <frelwizzen@gmail.com> - 2018-05-18 20:44 -0700
                Re: Global variables David Brown <david.brown@hesbynett.no> - 2018-05-19 17:22 +0200
                Re: Global variables supercat@casperkitty.com - 2018-05-19 11:56 -0700
                Re: Global variables supercat@casperkitty.com - 2018-05-06 16:28 -0700
                Re: Global variables Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2018-05-06 14:19 -0400
                Re: Global variables bartc <bc@freeuk.com> - 2018-05-06 20:16 +0100
                Re: Global variables David Brown <david.brown@hesbynett.no> - 2018-05-06 23:09 +0200
                Re: Global variables bartc <bc@freeuk.com> - 2018-05-06 23:41 +0100
                Re: The case AGAINST C Keith Thompson <kst-u@mib.org> - 2018-05-03 09:13 -0700
                Re: The case AGAINST C Dan Purgert <dan@djph.net> - 2018-05-03 17:29 +0000
                Re: The case AGAINST C gazelle@shell.xmission.com (Kenny McCormack) - 2018-05-03 19:24 +0000
                Re: The case AGAINST C Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-05-04 05:46 +0000
                Re: The case AGAINST C Dan Purgert <dan@djph.net> - 2018-05-04 10:55 +0000
                Re: The case AGAINST C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-05-04 04:03 -0700
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-04 12:31 +0100
                Re: The case AGAINST C already5chosen@yahoo.com - 2018-05-04 05:10 -0700
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-04 13:24 +0100
                Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-04 06:26 -0700
                Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-04 06:35 -0700
                Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-04 07:06 -0700
                Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-04 07:19 -0700
                Re: The case AGAINST C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-05-04 06:37 -0700
                Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-04 08:19 -0700
                Re: The case AGAINST C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-05-04 12:07 -0700
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-04 16:31 +0100
                Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-04 08:41 -0700
                Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-04 09:50 -0700
                Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-04 10:04 -0700
                Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-04 13:51 -0700
                Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-04 14:30 -0700
                Re: The case AGAINST C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-05-04 15:14 -0700
                Re: The case AGAINST C Robert Wessel <robertwessel2@yahoo.com> - 2018-05-04 11:18 -0500
                Re: The case AGAINST C Keith Thompson <kst-u@mib.org> - 2018-05-04 09:05 -0700
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-04 17:55 +0100
                Re: The case AGAINST C Keith Thompson <kst-u@mib.org> - 2018-05-04 10:54 -0700
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-04 19:18 +0100
                Re: The case AGAINST C Keith Thompson <kst-u@mib.org> - 2018-05-04 11:24 -0700
                Re: The case AGAINST C David Brown <david.brown@hesbynett.no> - 2018-05-06 16:45 +0200
                Re: The case AGAINST C jameskuyper@alumni.caltech.edu - 2018-05-04 11:51 -0700
                Re: The case AGAINST C supercat@casperkitty.com - 2018-05-04 12:15 -0700
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-04 21:56 +0100
                Re: The case AGAINST C David Brown <david.brown@hesbynett.no> - 2018-05-06 17:01 +0200
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-06 17:54 +0100
                Re: The case AGAINST C Keith Thompson <kst-u@mib.org> - 2018-05-06 13:38 -0700
                Re: The case AGAINST C bartc <bc@freeuk.com> - 2018-05-06 21:49 +0100
                Re: The case AGAINST C Richard Damon <Richard@Damon-Family.org> - 2018-05-06 17:19 -0400
                Re: The case AGAINST C Keith Thompson <kst-u@mib.org> - 2018-05-06 15:24 -0700
                Re: The case AGAINST C Keith Thompson <kst-u@mib.org> - 2018-05-06 15:16 -0700
                Re: The case AGAINST C Steve Carroll <frelwizzen@gmail.com> - 2018-05-06 23:55 -0700
                Re: The case AGAINST C Steve Carroll <frelwizzen@gmail.com> - 2018-05-06 11:59 -0700
        Re: The case AGAINST C fir <profesor.fir@gmail.com> - 2018-05-01 14:51 -0700
          Re: The case AGAINST C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-05-02 04:46 -0700

csiph-web