[Info-vax] Dave Cutler, Prism, DEC, Microsoft, etc.

Paul Raulerson paul at raulersons.com
Tue Dec 1 20:34:33 EST 2009


The type conversion is perfectly legal- depending upon the hardware though, you maybe asking for a really nasty blowup, and nothing says that buffer is aligned properly in memory to be an integer. 

-Paul

On Dec 1, 2009, at 5:10 AM, Richard Brodie wrote:

> 
> "JF Mezei" <jfmezei.spamnot at vaxination.ca> wrote in message 
> news:00cd4d03$0$6691$c3e8da3 at news.astraweb.com...
> 
>> if I have a 100 byte record, and bytes 7 though 10 inclusively contain
>> an integer, and I do:
>> 
>> myint = (int *) &(buffer + 6) ; /* hopefully I have the syntax right*/
>> 
>> In what way am I lying ?
> 
> You are making an incompatible type conversion. If you don't like
> the word 'lying', substitute, 'writing a program with undefined behaviour'
> instead. 
> 
> 
> _______________________________________________
> Info-vax mailing list
> Info-vax at rbnsn.com
> http://rbnsn.com/mailman/listinfo/info-vax_rbnsn.com
> 





More information about the Info-vax mailing list