P.S. - Re: calling exit in response to an error shouldn't be an error...

2019-06-10 Thread L A Walsh
On 2019/06/09 14:52, Zan Lynx wrote: > I haven't tested it but you might be able to make this work with a comma > operator like "while (gets(buf) || (exit(0), 1)) puts(buf);" > yes, I also tried that to verify whether or not I needed a work-around for gets, though using "xit(int s){ exit(s);}"

Re: calling exit in response to an error shouldn't be an error...

2019-06-10 Thread Jonathan Wakely
On Mon, 10 Jun 2019 at 22:54, L A Walsh wrote: > > On 2019/06/09 14:52, Zan Lynx wrote: > > I am not a GCC developer, just a regular user of C. But I have some > > comments below: > > > > On 6/9/2019 3:21 PM, L A Walsh wrote: > > > >> If I have a function returning NULL on error (including EOF). >

Re: calling exit in response to an error shouldn't be an error...

2019-06-10 Thread L A Walsh
On 2019/06/09 14:52, Zan Lynx wrote: > I am not a GCC developer, just a regular user of C. But I have some > comments below: > > On 6/9/2019 3:21 PM, L A Walsh wrote: > >> If I have a function returning NULL on error (including EOF). >> >> So the program calls exit if the function doesn't retur

Re: calling exit in response to an error shouldn't be an error...

2019-06-09 Thread Zan Lynx
I am not a GCC developer, just a regular user of C. But I have some comments below: On 6/9/2019 3:21 PM, L A Walsh wrote: If I have a function returning NULL on error (including EOF). So the program calls exit if the function doesn't return a non-zero value (func() || exit(1)). I have: --/tm

calling exit in response to an error shouldn't be an error...

2019-06-09 Thread L A Walsh
If I have a function returning NULL on error (including EOF). So the program calls exit if the function doesn't return a non-zero value (func() || exit(1)). I have: --/tmp/ex.c-- main() { char * buf[512]; while (gets(buf) || exit(0)) puts(buf); } -- compile w/: gcc -fpermissive --no-warnin