Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: Programming exercise/challenge Date: Tue, 08 Dec 2020 23:20:37 -0800 Organization: A noiseless patient Spider Lines: 21 Message-ID: <86zh2n5ttm.fsf@linuxsc.com> References: <86wnxwkyol.fsf@linuxsc.com> <20201208002703.08b47b3fce567f7096b14e59@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="5eb73538a536c16dceb299f9d9a18884"; logging-data="24239"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/F+qZ0otQImNI4mFSat6yM3RAyy/R9r6Y=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:rjXmPuUnFGoJpIGfdsPqEPIeBSk= sha1:2oFD0MjQlphfFv7lKQ+8BscV/8c= Xref: csiph.com comp.lang.c:157124 Anton Shepelev writes: > Tim Rentsch: > >> If EOF is seen inside a comment, do something sensible but >> it doesn't matter what as long as it's sensible. > > Is just stopping the program not sensible, e.g.: > > void main( void ) {} > /* commenging... > > may output > > void main( void ) {} > > and call it run? Yes that's fine. You might want to issue an error message, and/or give an error return status, but either way is perfectly okay.