[PATCH] gas: accept custom ".linefile <n> ."
Nick Clifton
nickc@redhat.com
Tue Nov 15 11:23:47 GMT 2022
Hi Jan,
>>> abort ();
>>
>> I still hate having calls to abort() in code. Much better to have
>> a helpful error message IMHO. Not important for this patch though.
>
> So do you consider gas_assert() better?
Not really. It still does not tell the user what has gone wrong, nor
does it help them avoid the problem. Sure they can report it, and having
an abort makes it easier for an investigator to use a debugger to catch
the problem, but in the meantime the user is still left wondering what
went wrong.
The assembler (and other tools) already have a well understood way of
telling the user that something has gone wrong - the exit status code,
along with, hopefully, an error message. So I think that it is best
to make use of it.
> But perhaps such could also be as_fatal().
Given a choice, I would definitely prefer as_fatal() over gas_assert()
or abort(). But this is just my preference. I am not laying down the
law here, and I am not going to reject patches just because they contain
calls to abort.
Cheers
Nick
More information about the Binutils
mailing list