> >> > x = odp_xxx_create(...); // error! => Returns XXX_INVALID > >> > y = odp_yyy_create(x, ....); // x == XXX_INVALID => error! > When in ODP will this be the recommended or desired practice? Either > the user will have to check the return values for success or the > different calls will have to check their inputs for validity. > > If we are trying to support a number of (non-obvious) design patterns > for the applications to use, these need to be documented (e.g. in > architecture document or user's guide).
There only one design pattern for application: check return values. We provide error check possibility for implementation. > > > > x = XXX_INVALID; //init > Why initialize x at all? The compiler will warn you if you are reading > x before it has been assigned a value. IMO default initializations are > dangerous. It documents your intention: by default I'm doing X. Yes, compiler can check that it's always set, but it does not which values produce correct behavior by default (e.g. fail/crash by default). -Petri _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org http://lists.linaro.org/mailman/listinfo/lng-odp