>>> You could define an xprintf() macro that checks if the return value
>>> is < 0 and simply calls perror() and exit(1) in such case.
>> Does such a macro belong to any general header file from the Linux
>> software library?
> No.
Would you like to add it?
How do you think about to reuse it in m
On 2016-11-03 20:48, SF Markus Elfring wrote:
>> You could define an xprintf() macro that checks if the return value
>> is < 0 and simply calls perror() and exit(1) in such case.
>
> Does such a macro belong to any general header file from the Linux
> software library?
No.
Michal
> You could define an xprintf() macro that checks if the return value
> is < 0 and simply calls perror() and exit(1) in such case.
Does such a macro belong to any general header file from the Linux
software library?
Regards,
Markus
Dne 2.11.2016 v 19:46 SF Markus Elfring napsal(a):
>> I like the code as is.
>
> Do you really prefer to ignore important return values in the discussed
> function?
You could define an xprintf() macro that checks if the return value is <
0 and simply calls perror() and exit(1) in such case.
Mic
> I like the code as is.
Do you really prefer to ignore important return values in the discussed
function?
> Such error checks and magic numbers are messy.
Is it safer to detect exceptional situations as early as possible here?
Regards,
Markus
2016-11-03 2:48 GMT+09:00 SF Markus Elfring :
>> Is replacing printf("\"\n") with puts("\"") optimization?
>
> Is the difference relevant if an “ordinary” string is passed instead of
> a format string?
I think GCC does the replacement automatically
unless -ffreestanding option is given.
With a q
> Is replacing printf("\"\n") with puts("\"") optimization?
Is the difference relevant if an “ordinary” string is passed instead of
a format string?
> Frankly, the result of this patch seems extremely unreadable code.
Do you care for more complete error detection and corresponding exception
ha
7 matches
Mail list logo