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


Groups > comp.lang.c > #103553

Re: How to find the problem in the object file

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c
Subject Re: How to find the problem in the object file
Date 2017-02-10 08:01 +1300
Message-ID <eg3sk0F1hapU4@mid.individual.net> (permalink)
References (8 earlier) <ln60ks78rd.fsf@kst-u.example.com> <kfna8a193yb.fsf@x-alumni2.alumni.caltech.edu> <lnshnt38oz.fsf@kst-u.example.com> <kfnfujo6ib1.fsf@x-alumni2.alumni.caltech.edu> <o7hcuh$3oh$1@dont-email.me>

Show all headers | View raw


On 02/ 9/17 10:33 PM, David Brown wrote:
> On 09/02/17 06:32, Tim Rentsch wrote:
>> Keith Thompson <kst-u@mib.org> writes:
>>
>>> Tim Rentsch <txr@alumni.caltech.edu> writes:
>>> [...]
>>>
>>> (Context:  Removing non-prototype function declarations and definitions
>>> from the language.)
>>>
>>>> My question here is a little different.  Knowing that other
>>>> people consider them worth keeping, what explains the reaction
>>>> of wanting to exclude them anyway?  Is it just a "my opinions
>>>> count, and other people's don't" sort of attitude, or is it
>>>> something else?
>>>
>>> I didn't say that other people's opinions don't count.  I have
>>> my opinion, which I've already expressed, that old-style function
>>> declarations and definitions should be removed from the language.
>>
>> I understand these comments.  You are expressing a personal value
>> judgment.  Fine so far.
>>
>>> In C99, the committee removed implicit int from the language, and it
>>> hadn't even been marked as obsolescent.  I agree with that decision,
>>> and similar reasons apply to non-prototype function declarations
>>> and definitions.  Removing them would make C a better language.
>>
>> These comments are what I don't understand.  Essentially everyone
>> agreed that implicit int could be removed without any serious
>> loss, especially since there was something to replace it (eg,
>> either 'int' or 'void', depending).  Not everyone agrees that
>> non-prototype function declarations can be removed without any
>> serious loss, and IIUC what you're suggesting is that they be
>> removed without any sort of replacement for the capability.  The
>> two cases don't seem that analogous.  So I don't see how you get
>> to your conclusion, unless it is something like discounting of
>> other people's opinions.
>>
>
> It can be difficult to decide where to draw lines here.  Sure, there are
> some people who still find non-prototype function declarations to be
> useful.  But how do those few compare to the numbers of people that make
> mistakes, or write poorer quality code, by using non-prototype function
> declarations?  I have no statistics here, and I suspect neither do you,
> Keith, or the C standards committee.
>
> But I am at a loss to imagine a use of non-prototype functions that
> cannot be replaced by prototyped functions and/or macros.  You cannot
> call a function without knowing the parameters and types - if they don't
> match up with the function's definition, then the program will be
> incorrect (it will have undefined behaviour).
>
> At best, non-prototype function declarations might let you do some basic
> syntax checking of your code before it can run - but a macro of the form
> "#define foo(...)" should work just as well.  I believe that it most, or
> all, cases where non-prototype function declarations are used, there are
> alternative solutions that are usually better or at least not too
> onerous.  (Feel free to provide counter-examples - maybe my imagination
> is limited here.)
>
> So to my mind, the cases /are/ analogous - it would be a change that can
> cause problems for older or "looser" code, but which removes a source of
> errors and improves code rigour.

That is the view taken by a couple of teams I worked with in the 90s who 
used C++ compilers to "lint" their code in order to remove that 
particular source of errors.  It is also my opinion!

-- 
Ian

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


Thread

How to find the problem in the object file Alla _ <modelling.data@gmail.com> - 2017-01-26 05:14 -0800
  Re: How to find the problem in the object file BartC <bc@freeuk.com> - 2017-01-26 13:22 +0000
    Re: How to find the problem in the object file BartC <bc@freeuk.com> - 2017-01-26 13:37 +0000
  Re: How to find the problem in the object file Richard Heathfield <rjh@cpax.org.uk> - 2017-01-26 13:53 +0000
    Re: How to find the problem in the object file Alla _ <modelling.data@gmail.com> - 2017-01-26 06:20 -0800
      Re: How to find the problem in the object file BartC <bc@freeuk.com> - 2017-01-26 14:28 +0000
        Re: How to find the problem in the object file Alla _ <modelling.data@gmail.com> - 2017-01-26 06:48 -0800
        Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-01-26 08:29 -0800
          Re: How to find the problem in the object file BartC <bc@freeuk.com> - 2017-01-26 16:54 +0000
            Re: How to find the problem in the object file luser droog <luser.droog@gmail.com> - 2017-01-26 09:01 -0800
            Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-01-26 11:20 -0800
            Re: How to find the problem in the object file David Brown <david.brown@hesbynett.no> - 2017-01-26 23:12 +0100
              Re: How to find the problem in the object file BartC <bc@freeuk.com> - 2017-01-27 01:32 +0000
                Re: How to find the problem in the object file David Brown <david.brown@hesbynett.no> - 2017-01-27 09:50 +0100
          Re: How to find the problem in the object file supercat@casperkitty.com - 2017-01-26 09:19 -0800
            Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-01-26 11:21 -0800
              Re: How to find the problem in the object file Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-02 02:39 -0800
                Re: How to find the problem in the object file fir <profesor.fir@gmail.com> - 2017-02-02 04:08 -0800
                Re: How to find the problem in the object file fir <profesor.fir@gmail.com> - 2017-02-02 04:31 -0800
                Re: How to find the problem in the object file Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-04 10:48 -0800
                Re: How to find the problem in the object file fir <profesor.fir@gmail.com> - 2017-02-04 11:07 -0800
                Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-02-02 10:22 -0800
                Re: How to find the problem in the object file Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-04 11:00 -0800
                Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-02-04 14:14 -0800
                Re: How to find the problem in the object file Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-02-04 20:02 -0800
                Re: How to find the problem in the object file supercat@casperkitty.com - 2017-02-05 13:39 -0800
                Re: How to find the problem in the object file Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-02-05 13:44 -0800
                Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-02-05 13:56 -0800
                Re: How to find the problem in the object file Ian Collins <ian-news@hotmail.com> - 2017-02-06 13:07 +1300
                Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-02-05 16:14 -0800
                Re: How to find the problem in the object file Ian Collins <ian-news@hotmail.com> - 2017-02-06 13:24 +1300
                Re: How to find the problem in the object file David Brown <david.brown@hesbynett.no> - 2017-02-06 01:59 +0100
                Re: How to find the problem in the object file Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-08 21:32 -0800
                Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-02-05 13:54 -0800
                Re: How to find the problem in the object file Ian Collins <ian-news@hotmail.com> - 2017-02-06 11:18 +1300
                Re: How to find the problem in the object file Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-08 21:32 -0800
                Re: How to find the problem in the object file David Brown <david.brown@hesbynett.no> - 2017-02-09 10:33 +0100
                Re: How to find the problem in the object file supercat@casperkitty.com - 2017-02-09 09:10 -0800
                Re: How to find the problem in the object file Ian Collins <ian-news@hotmail.com> - 2017-02-10 08:01 +1300
                Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-02-09 09:01 -0800
                Re: How to find the problem in the object file supercat@casperkitty.com - 2017-02-09 09:35 -0800
                Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-02-09 09:57 -0800
                Re: How to find the problem in the object file Jean-Marc Bourguet <jm@bourguet.org> - 2017-02-09 20:45 +0100
                Re: How to find the problem in the object file supercat@casperkitty.com - 2017-02-09 14:59 -0800
                Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-02-09 15:20 -0800
                Re: How to find the problem in the object file supercat@casperkitty.com - 2017-02-09 16:12 -0800
                Re: How to find the problem in the object file David Brown <david.brown@hesbynett.no> - 2017-02-13 10:21 +0100
                Re: How to find the problem in the object file supercat@casperkitty.com - 2017-02-13 07:20 -0800
                Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-02-13 09:28 -0800
                Re: How to find the problem in the object file David Brown <david.brown@hesbynett.no> - 2017-02-13 09:55 +0100
                Re: How to find the problem in the object file Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-16 03:36 -0800
                Re: How to find the problem in the object file Jean-Marc Bourguet <jm@bourguet.org> - 2017-02-09 20:56 +0100
                Re: How to find the problem in the object file Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-16 07:00 -0800
                Re: How to find the problem in the object file David Brown <david.brown@hesbynett.no> - 2017-02-16 20:03 +0100
                Re: How to find the problem in the object file Ian Collins <ian-news@hotmail.com> - 2017-02-17 09:22 +1300
                Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-02-16 13:07 -0800
                Re: How to find the problem in the object file Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-24 09:21 -0800
                Re: How to find the problem in the object file Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-24 09:02 -0800
                Re: How to find the problem in the object file Ian Collins <ian-news@hotmail.com> - 2017-02-25 09:05 +1300
                Re: How to find the problem in the object file Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-24 09:26 -0800
                Re: How to find the problem in the object file David Brown <david.brown@hesbynett.no> - 2017-02-25 19:38 +0100
                Re: How to find the problem in the object file Ian Collins <ian-news@hotmail.com> - 2017-02-03 07:32 +1300
                Re: How to find the problem in the object file Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-04 11:24 -0800
                Re: How to find the problem in the object file Robert Wessel <robertwessel2@yahoo.com> - 2017-02-02 16:56 -0600
                Re: How to find the problem in the object file Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-04 11:12 -0800
                Re: How to find the problem in the object file Robert Wessel <robertwessel2@yahoo.com> - 2017-02-06 04:47 -0600
                Re: How to find the problem in the object file Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-08 21:59 -0800
                Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-02-09 09:13 -0800
                Re: How to find the problem in the object file Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-15 19:28 -0800
                Re: How to find the problem in the object file Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-02-24 17:48 -0800
                Re: How to find the problem in the object file Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-25 17:36 -0800
      Re: How to find the problem in the object file David Brown <david.brown@hesbynett.no> - 2017-01-26 15:51 +0100
        Re: How to find the problem in the object file Alla _ <modelling.data@gmail.com> - 2017-01-26 08:29 -0800
          Re: How to find the problem in the object file Richard Heathfield <rjh@cpax.org.uk> - 2017-01-26 16:34 +0000
            Re: How to find the problem in the object file Alla _ <modelling.data@gmail.com> - 2017-01-26 09:48 -0800
          Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-01-26 08:52 -0800
          Re: How to find the problem in the object file James Kuyper <jameskuyper@verizon.net> - 2017-01-26 13:53 -0500
            Re: How to find the problem in the object file supercat@casperkitty.com - 2017-01-26 11:00 -0800
          Re: How to find the problem in the object file David Brown <david.brown@hesbynett.no> - 2017-01-26 23:49 +0100
            Re: How to find the problem in the object file Alla _ <modelling.data@gmail.com> - 2017-01-27 06:08 -0800
              Re: How to find the problem in the object file David Brown <david.brown@hesbynett.no> - 2017-01-27 16:20 +0100
        Re: How to find the problem in the object file Keith Thompson <kst-u@mib.org> - 2017-01-26 08:41 -0800
          Re: How to find the problem in the object file m.labanowicz@gmail.com - 2017-01-27 01:26 -0800

csiph-web