| |
|
|
|
| PA6488开发指南 - 已知错误 |
| | |
| 函数include |
调用函数时必须include相关的include文件.
例如调用sprintf()而没有include stdio.h的话编译器并不会抱错, 但是执行结果会跑飞.
|
| | |
| 结构中跨越32位边界的数据 |
当结构映射到内存中时, 在结构中跨越32位边界的UINT的值会出错.
在arp.c中发现
typedef struct _ARP_FORMAT
{
USHORT sHardwareType; /* hardware type */
USHORT sProtocolType; /* protocol type */
UCHAR cHardwareLen; /* hardware address length */
UCHAR cProtocolLen; /* protocol address length */
USHORT sOperation; /* T_ARP_FORMAT operation (see AR_XXXX list above) */
UCHAR pcSHA[HW_ALEN]; /* sender's physical hardware address */
UCHAR pcSPA[IP_ALEN]; /* sender's protocol address (IP addr.) */
UCHAR pcTHA[HW_ALEN]; /* target's physical hardware address */
UCHAR pcTPA[IP_ALEN]; /* target's protocol address (IP) */
} T_ARP_FORMAT;
如果改为
typedef struct _ARP_FORMAT
{
USHORT sHardwareType; /* hardware type */
USHORT sProtocolType; /* protocol type */
UCHAR cHardwareLen; /* hardware address length */
UCHAR cProtocolLen; /* protocol address length */
USHORT sOperation; /* T_ARP_FORMAT operation (see AR_XXXX list above) */
UCHAR pcSHA[HW_ALEN]; /* sender's physical hardware address */
UINT iSPA; /* sender's protocol address (IP addr.) */
UCHAR pcTHA[HW_ALEN]; /* target's physical hardware address */
UINT iTPA; /* target's protocol address (IP) */
} T_ARP_FORMAT;
iSPA的值是错误的, 而iTPA是正确的.
|
|