Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #142728
| Subject | Re: C Translator |
|---|---|
| Newsgroups | comp.lang.c |
| References | (17 earlier) <ln4l7ha26w.fsf@kst-u.example.com> <uzvoE.997630$Apg.19823@fx36.am4> <lnzhp98g15.fsf@kst-u.example.com> <xsyoE.465108$0_.172284@fx19.am4> <lnr2al889f.fsf@kst-u.example.com> |
| From | Bart <bc@freeuk.com> |
| Message-ID | <pBGoE.607872$M53.329707@fx31.am4> (permalink) |
| Organization | virginmedia.com |
| Date | 2019-04-02 11:13 +0100 |
On 02/04/2019 03:13, Keith Thompson wrote: > Bart <bc@freeuk.com> writes: >> Do you think that function would have survived like that if every C >> compiler gave a fatal error? No. This is why there is some poor quality >> software around. > > C does not require a diagnostic for a missing return statement in a > non-void function. (The behavior is undefined only if the caller uses > the returned value.) This is, I think, because a lot of pre-ANSI code > used int functions as a stand-in for void functions, which didn't exist > yet, and requiring a diagnostic would break old code. > > If you think I'm saying that I *like* the fact that no diagnostic is > required, I invite you to re-read the previous paragraph as many times > as it takes for you to realize that I didn't say that. The function is exported (ie. it has 'external linkage' and could be called from other modules (ie. other 'translation units')). So a compiler cannot know if it is called or not (or not easily; it would need to do a careful analysis as to whether any external functions are called that could then call seq()). If there is a problem with it, then it must be reported. If the reason for not reporting is because 40 years ago C had no procedures or subroutines, then surely that loophole should long have been fixed. Have /one/ legacy option for ancient code that you can't touch, and that's taken care of. > > I just took a look at that article. The seq function is never called. > I don't know what the intent was, but my guess is that both the body of > the function and any code that calls it is to be filled in later. > If > you wanted to point out a problem with the seq() function, you could > have posted in that thread. The author might even have explained. It would be off-topic and be seen as pedantic nit-picking, as I'd be looking at it as an example of C code, rather than whatever the hell it does (I've no idea). (BTW here's a version of that program that doesn't use designated initialisers: https://github.com/sal55/qx/blob/master/norah.c. I wanted to try translating it, but those initialisers weren't supported (also I couldn't see how that part worked), so removing them was necessary. However there were some other problems. Among them the use of "int", "Int" and "INT" in a target language that is case-insensitive...)
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
C Translator Bart <bc@freeuk.com> - 2019-03-28 16:16 +0000
Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 00:01 +0000
Re: C Translator Robert Wessel <robertwessel2@yahoo.com> - 2019-03-28 20:31 -0500
Re: C Translator Keith Thompson <kst-u@mib.org> - 2019-03-28 19:02 -0700
Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 02:34 +0000
Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-03-29 10:58 +0100
Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 12:47 +0000
Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-03-29 14:57 +0100
Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 14:57 +0000
Re: C Translator fir <profesor.fir@gmail.com> - 2019-03-29 15:08 -0700
Re: C Translator fir <profesor.fir@gmail.com> - 2019-03-29 15:42 -0700
Re: C Translator scott@slp53.sl.home (Scott Lurndal) - 2019-03-29 15:16 +0000
Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 15:30 +0000
Re: C Translator fir <profesor.fir@gmail.com> - 2019-03-29 14:47 -0700
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-29 10:42 +0000
Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 11:57 +0000
Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 13:04 +0000
Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-03-29 14:58 +0100
Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 14:29 +0000
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-29 20:06 +0000
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-29 20:02 +0000
Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 21:10 +0000
Re: C Translator nobody@example.org (Scott) - 2019-03-30 04:52 +0000
Re: C Translator Bart <bc@freeuk.com> - 2019-03-30 11:03 +0000
Re: C Translator nobody@example.org (Scott) - 2019-03-30 16:17 +0000
Re: C Translator Bart <bc@freeuk.com> - 2019-03-30 18:36 +0000
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-30 20:32 +0000
Re: C Translator Bart <bc@freeuk.com> - 2019-03-30 22:44 +0000
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-31 03:23 +0100
Re: C Translator Bart <bc@freeuk.com> - 2019-03-31 12:39 +0100
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-31 15:07 +0100
Re: C Translator Bart <bc@freeuk.com> - 2019-03-31 16:21 +0100
Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-03-31 21:19 +0200
Re: C Translator Bart <bc@freeuk.com> - 2019-03-31 20:58 +0100
Re: C Translator Ike Naar <ike@iceland.freeshell.org> - 2019-03-31 20:33 +0000
Re: C Translator Bart <bc@freeuk.com> - 2019-03-31 22:06 +0100
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-31 22:37 +0100
Re: C Translator Bart <bc@freeuk.com> - 2019-03-31 23:33 +0100
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-04-01 02:35 +0100
Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-01 11:33 +0200
Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-03-31 23:54 +0200
Re: C Translator Bart <bc@freeuk.com> - 2019-04-01 02:16 +0100
Re: C Translator Ike Naar <ike@iceland.freeshell.org> - 2019-04-01 06:42 +0000
Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-01 11:35 +0200
Re: C Translator Bart <bc@freeuk.com> - 2019-04-01 16:54 +0100
Re: C Translator Bart <bc@freeuk.com> - 2019-04-01 21:01 +0100
Re: C Translator Keith Thompson <kst-u@mib.org> - 2019-04-01 13:41 -0700
Re: C Translator Bart <bc@freeuk.com> - 2019-04-01 22:40 +0100
Re: C Translator Keith Thompson <kst-u@mib.org> - 2019-04-01 16:25 -0700
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-04-02 00:50 +0100
Re: C Translator Keith Thompson <kst-u@mib.org> - 2019-04-01 17:45 -0700
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-04-02 11:28 +0100
Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-02 13:18 +0200
Re: C Translator Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-04-02 19:15 +0000
Re: C Translator Bart <bc@freeuk.com> - 2019-04-02 21:14 +0100
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-04-02 13:28 +0100
Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-02 10:49 +0200
Re: C Translator Bart <bc@freeuk.com> - 2019-04-02 01:58 +0100
Re: C Translator Keith Thompson <kst-u@mib.org> - 2019-04-01 19:13 -0700
Re: C Translator Bart <bc@freeuk.com> - 2019-04-02 11:13 +0100
Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-02 13:49 +0200
Re: C Translator Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2019-04-02 05:15 -0700
Re: C Translator Bart <bc@freeuk.com> - 2019-04-02 14:50 +0100
Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-02 16:06 +0200
Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-02 16:05 +0200
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-04-02 00:11 +0100
Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-02 10:35 +0200
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-04-02 00:06 +0100
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-31 21:36 +0100
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-31 16:32 +0100
Re: C Translator Bart <bc@freeuk.com> - 2019-03-30 00:37 +0000
Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-30 01:00 +0000
Re: C Translator fir <profesor.fir@gmail.com> - 2019-03-30 03:37 -0700
Re: C Translator fir <profesor.fir@gmail.com> - 2019-03-30 06:15 -0700
Re: C Translator James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-03-29 07:49 -0700
csiph-web