[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GUB and mpfr/mpc

From: Masamichi HOSODA
Subject: Re: GUB and mpfr/mpc
Date: Sun, 02 Nov 2014 10:32:14 +0900 (JST)

> Masamichi HOSODA <address@hidden> writes:
>> How about this patch?
>> --- librestrict/      2014-10-19 09:52:52.951262300 +0900
>> +++ librestrict/xstatconv.c  2014-11-01 20:26:35.734854500 +0900
>> @@ -48,20 +48,16 @@
>>        {
>>      struct stat *buf = ubuf;
>> +    /* zero clear */
>> +    memset(buf, 0, sizeof(*buf));
>>      /* Convert to current kernel version of `struct stat'.  */
>>      buf->st_dev = kbuf->st_dev;
> On the surface of it, this looks very reasonable.  However, since
> everything is guarded with #ifdef and similar and the definitions are
> probably generated by autoconf, it would appear that different versions
> of stat.h are employed in the compilation and the resulting mismatch of
> definitions and structures (possibly between host and target
> definitions) could lead to crashes and memory corruption.
> So it would seem like a good idea to first figure out what goes wrong
> here before fixing it in this manner.  It might be a nice fix (and the
> code certainly looks nicer for it) but I have no idea if it is correct.
> The "if it were that easy, it would have been written like that in the
> first place" mantra may be wrong surprisingly often, but it would still
> be nice to make sure.
> -- 
> David Kastrup

librestrict does not have a configure script. 
Therefore, it does not use autoconf.
Furthermore, in my understanding, librestrict is not cross compiled. 
That is, the host and the target is always the same as host OS.

If this is right, I think that my patch does not have a problem. 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]