change log for rtems (2010-06-15)
Chris Johns
chrisj at rtems.org
Wed Jun 16 08:26:46 UTC 2010
On 16/06/10 5:26 PM, Sebastian Huber wrote:
> On 06/15/2010 06:11 PM, rtems-vc at rtems.org wrote:
> [...]
>> diff -u rtems/cpukit/ChangeLog:1.2346.2.16 rtems/cpukit/ChangeLog:1.2346.2.17
>> --- rtems/cpukit/ChangeLog:1.2346.2.16 Tue Jun 15 08:35:48 2010
>> +++ rtems/cpukit/ChangeLog Tue Jun 15 10:17:42 2010
>> @@ -1,5 +1,6 @@
>> 2010-06-15 Ralf Corsépius<ralf.corsepius at rtems.org>
>>
>> + * libfs/src/rfs/rtems-rfs-file-system.h: Remove bogus typecast.
>> * libfs/src/rfs/rtems-rfs-block.c, libfs/src/rfs/rtems-rfs-buffer.c,
>> libnetworking/nfs/bootp_subr.c: Misc. 64bit-compatibility fixes.
>> * posix/include/rtems/posix/pthread.h: Remove stray comment.
>>
>> diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-file-system.h:1.3 rtems/cpukit/libfs/src/rfs/rtems-rfs-file-system.h:1.4
>> --- rtems/cpukit/libfs/src/rfs/rtems-rfs-file-system.h:1.3 Thu Feb 25 23:54:59 2010
>> +++ rtems/cpukit/libfs/src/rfs/rtems-rfs-file-system.h Tue Jun 15 10:17:35 2010
>> @@ -308,7 +308,7 @@
>> *
>> * @param _fs Pointer to the file system.
>> */
>> -#define rtems_rfs_fs_size(_fs) (((uint64_t) rtems_rfs_fs_blocks (_fs)) * \
>> +#define rtems_rfs_fs_size(_fs) (rtems_rfs_fs_blocks (_fs) * \
>> rtems_rfs_fs_block_size (_fs))
>>
>> /**
>>
> [...]
>
> The blocks and block_size fields are of type size_t, thus I don't think that
> this type cast is bogus.
>
Hmm indeed the change would seem broken. The original and I think
correct code created an intermediate value in compiler that is 64bits in
size so the maths would not truncate. The cast is needed and valid. The
RFS is a 64bit file system. It was carefully tested on large disks and
large files. If uint64_t is not supported by a target or broken then I
would assert the target is broken as my understanding is uint64_t is
standard.
If a warning appears when assigning the result then there is a problem
in that area.
If the implementation of how the macro is done is not correct then lets
fix that. If the 64bit target needs something different or creates
warnings lets seem them and fix them.
I will now have to go back and review all the changes in detail to the
RFS. Unless these type of changes, ie not printf ones are reverted, I
would have to say the RFS is broken and so this effects the 4.10
release. I see the comment on the 4.10 branch but view cvs is broken on
the 4.10 branch so not review the "bogus" cast claim.
> Since size_t may have only 16-bits on some architectures we should consider to
> use uint32_t for these fields.
If this is the case then I may review this for 4.11.
Thanks for pointing this out.
Chris
More information about the vc
mailing list