[asterisk-dev] [Code Review] use autoconf to detect whether alignment should be enforced
wdoekes
reviewboard at asterisk.org
Fri Oct 28 04:01:50 CDT 2011
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1551/
-----------------------------------------------------------
Review request for Asterisk Developers.
Summary
-------
This patch takes a different approach to the mentioned bug.
I added an autoconf script to detect whether integer misalignment causes failures or not. This autoconf define HAVE_NO_MISALIGNMENT can then be used instead of __sparc__ and __arm__ and __some_other_arch__.
Note that this is *not* mutually exclusive with https://reviewboard.asterisk.org/r/1549. If that code is committed, this could still be added but without the changes in main/utils.c. This just won't be as important anymore.
Regards,
Walter
(I also replaced the modulo sizeof(ast_string_field_allocation) with modulo 2. The rest of the code assumed it was 2, and now that's more obvious.)
This addresses bug ASTERISK-17310.
https://issues.asterisk.org/jira/browse/ASTERISK-17310
Diffs
-----
/branches/1.8/autoconf/ast_c_no_misalign.m4 PRE-CREATION
/branches/1.8/configure.ac 342659
/branches/1.8/include/asterisk/autoconfig.h.in 342659
/branches/1.8/include/asterisk/unaligned.h 342659
/branches/1.8/main/utils.c 342659
Diff: https://reviewboard.asterisk.org/r/1551/diff
Testing
-------
S Adrian from the bug report tested whether the autoconf script put HAVE_NO_MISALIGNMENT in autoconfig.h. It does on his ARM.
Thanks,
wdoekes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20111028/b4f9fb71/attachment.htm>
More information about the asterisk-dev
mailing list