<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Cyril,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Sorry for late reply, since it was China holidays in past two weeks.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 7, 2019 at 8:51 PM Cyril Hrubis <<a href="mailto:chrubis@suse.cz">chrubis@suse.cz</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> AFAICT that changing an variable of one data type into another, and<br>
> the worst harmness is to loss of information in the variable so we'd<br>
> better avoid that. But in this test we only need a invalid DIR* for<br>
> readdir() tesst, it does *not* really care about the pointer content I<br>
> guess?<br>
<br>
Not at all, both FILE and DIR are typedefs to C structures, which are<br>
just chunks of memory, by doing this you are basically passing random<br>
data to the call because all it does when the C library gets the fd from<br>
these strucutres is that it takes bytes from at some offest in the chunk<br>
of memory. There are no abstract types, methods or objects in C, just<br>
chunks of memory.<br><br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Ok, I got the point, thanks for the explanation. I will help to rewrite a new patch for readdir02 deleting.</div></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>