> I think this is OK, it does not change the return value, it is still
> reported as an error/exception condition, not ERROR_OK. So for the
> codebase nothing is changed. In the calling functions we do fall back to
> smaller buffers or alternative implementations. So the error warning
> should be generated in the calling code, if at all.
>
> I am in favour.


There are a couple of problems with this patch:

- it doesn't address the problem in a general fashion
- it breaks the general rule in OpenOCD that we report the error at
the site that it occurred and that we *do not* try to communicate
information about what went wrong using the return error code. The
return error code is to be treated as a boolean(either ERROR_OK or
not).
- it does not fix all the calling sites where an error message *should*
be displayed.

The right solution(not hard) is to implement something that achieves the same
as a try-catch:

- disable error messages
- invoke fn
- reenable error messages


-- 
Øyvind Harboe
Embedded software and hardware consulting services
http://www.zylin.com
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to