[SSSD] [PATCHES] Alignment issues reported by Clang

Lukas Slebodnik lslebodn at redhat.com
Thu Sep 12 11:55:00 UTC 2013


On (11/09/13 17:05), Michal Židek wrote:
>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

I checked coverity with aggresive flags enabled.

1) There isn't new warning.

2) One warning is fixed:
 WARNING: PW.MIXED_ENUM_TYPE: [#def1]
 sssd-1.11.1/src/sss_client/idmap/sss_nss_idmap.c:120: mixed_enum_type:
 enumerated type mixed with another type

LS



More information about the sssd-devel mailing list