MISRA-C:指针、结构体、联合体的安全规范

所需积分/C币:23 2017-04-27 16:57:49 102KB PDF

解析如何安全而高效地应用指针、结构体和联合体。
LEARNING GARDEN学习园地 0xO1、0x02、0x030x04, Intel read msg 0x4321;M read msg 0x1234 Motorola 18.4 ad msg() 0x1234 《MIS RA-C:2004》 MISRA一C MISRA-C 2.1 typedef union CPU uint8 t bytes4 《 MISRA-C:2004》 unit32 t read msg(void)i word msg t tmp; 18. buteo] tmp wo bywell] tmp. wor 8 ISO C tmp bytes[l]= read byte; 《 MISRA-C tmp. bytes[2]=- read byte; 2004》 SO C tmp. bytesl3= read byte(; return( tmp word) 《 MISRA-O:2004》 () uint32 t read msg(void )i uint 32 t word word=((unit32 tread byte())<24 word=word (((unit32 t)read byte())<<16); 1 MISRA-C: 2004. Guidelines for the use of the c language ir word= word (((unit32 t)read byte())<<8) critical systems. The Motor Industry Software Reliability As word=word| ((unit32 t)read byte()) sociation. 2004 return( word) 2 Harbison Ill. Samuel P, Steele Jr. Guy 003 enig 2.1 ,2002 2.2 2.1 Intel 80x86/ 4 ISO/ IEC 9899: 1999, International Organization of Standardi Pentium (little-endian zation, 199 9 )CPU Mo torola 68K ( big-endian 9.4.http://c-fag-chn.sourceforge.net/ccfag/index.html )CPU :2005-11-21) read byte() paper(@mesne.com.cn( Microcontrollers Embedded System

...展开详情
img
  • 分享王者

    成功上传51个资源即可获取

关注 私信 TA的资源

上传资源赚积分,得勋章
    最新推荐