[linux-cifs-client] Re: date/timestamp problem fixed, gz with 2.6 files posted

Matt Seitz seitz at metadata-systems.com
Thu Feb 5 19:52:25 GMT 2004


Steve French wrote:
> Fun - turns out
> gcc does not promote immediately size promote (like some other
> compilers) to the left hand side size.
> 
> 	u64 dce_time = unix_time_which_is_u32 * 10000000;
> 
> overflows and to work requires a cast of the right hand side elements to
> u64.  Very strange.

That's how the C Standard says things are supposed to work.  The type of the 
result of the multiplication operator is determined solely by the types of the 
two operands.  The fact that the result will then be assigned to a u64 object 
has no effect on the initial result of the multiplication.

I suggest something like

u64 const dce_ticks_per_second =10000000;
u64 dce_time = unix_time_which_is_u32 * dce_ticks_per_second;



More information about the linux-cifs-client mailing list