|
|
|
|
|
|
|
|
|
|
xen-devel
RE: [Xen-devel] [PATCH] Pointer should be checked before use
>Callers should not pass null pointers. If they do it is better for
>the program to explode sooner than later; that makes tracking the
>fault much easier.
>
>So this kind of check, turning incoming null pointers into error
>returns, is a bad idea.
>
That may be better for debug tracking to let the caller process
segfault:). However, IMO as a function it's almost always a good
practice to check the parameters' validation before using it. Returning
an error if the caller passes invalid arguments is a more normal
behavior than directly letting the process be killed due to no argument
check. It may be too strict.
Regards,
Xiaowei
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|