|
From: | Alain M. |
Subject: | Re: [lwip-users] Problem With dns.c Using 32-Bit Compilers |
Date: | Thu, 28 Aug 2008 20:01:44 -0300 |
User-agent: | Thunderbird 2.0.0.6 (X11/20070728) |
Jonathan Larmour escreveu:
char dns_answer[10]; #define dns_answer_type (*((u16_t*)dns_answer))Unfortunately, the above is still not portable. That may well cause a mis-aligned access if dns_answer is not already aligned, and being char that isn't guaranteed.
I believe that for byte access it should never get an error, do you know of an exception?
As for alignment, as it is independand of packing, as far as I know (not much in this case) arrays start aligned if that is the compiler setting.
Alain
[Prev in Thread] | Current Thread | [Next in Thread] |