[SSSD] [PATCHES] Alignment issues reported by Clang

Michal Židek mzidek at redhat.com
Wed Sep 11 15:05:35 UTC 2013


Patches 1-4 and 9:
These patches use the SAFEALIGN macros where it is appropriate. I split 
them into several patches for easier review, so that client code changes 
are not mixed with the rest of the code and changes that are a little 
different than the rest have their own patch.

Patches 5-6:
Here I think it is not needed to use uint8_t* or char*. We cast the 
pointer anyway and there are no real alignment issues (the memory is 
aligned properly). I was thinking about suppressing the warnings with 
#pragma here, but in this particular situation it is IMO better to have 
just void*.

Patches 7-8:
These were all false positive warnings. It is possible to suppress them 
with additional casting but I found it less readable so I used #pragma.

Patch 10:
We had improperly aligned part of a buffer used in client code. Also
some code blocks here must rely on fact that the buffer they get is
aligned properly (they can do nothing about it if it isn't). In these
cases it is better to silence the warnings, so that it does not make
permanent noise during compilation.

Thanks
Michal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-sss_client-Use-SAFEALIGN_COPY_-type-macros-where-app.patch
Type: text/x-patch
Size: 14105 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130911/5c78b382/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-sss_client-Use-SAFEALIGN_SETMEM_-type-macros-where-a.patch
Type: text/x-patch
Size: 1675 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130911/5c78b382/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-krb5-Alignment-warning-reported-by-clang.patch
Type: text/x-patch
Size: 1896 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130911/5c78b382/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-responder-Use-SAFEALIGN-macros-where-appropriate.patch
Type: text/x-patch
Size: 11414 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130911/5c78b382/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-responder-Use-void-instead-of-uint8_t.patch
Type: text/x-patch
Size: 1444 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130911/5c78b382/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-Use-void-when-working-with-arbitary-buffer.patch
Type: text/x-patch
Size: 860 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130911/5c78b382/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-Warning-when-casting-struct-sockaddr.patch
Type: text/x-patch
Size: 1946 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130911/5c78b382/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-refcount-Ignore-safealign-warnings-reported-by-Clang.patch
Type: text/x-patch
Size: 966 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130911/5c78b382/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0009-responder-Use-SAFEALIGN-macro-when-checking-pam-data.patch
Type: text/x-patch
Size: 1548 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130911/5c78b382/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0010-Properly-align-buffer-when-storing-pointers.patch
Type: text/x-patch
Size: 2935 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130911/5c78b382/attachment-0009.bin>


More information about the sssd-devel mailing list