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);}"
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).
>
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
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
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