Bug 145915 - Fix cast-align warning in NetworkStateNotifierEfl.cpp
Summary: Fix cast-align warning in NetworkStateNotifierEfl.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Csaba Osztrogonác
URL:
Keywords:
Depends on:
Blocks: 145121
  Show dependency treegraph
 
Reported: 2015-06-12 04:03 PDT by Csaba Osztrogonác
Modified: 2015-07-22 09:09 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.59 KB, patch)
2015-07-09 03:15 PDT, Csaba Osztrogonác
no flags Details | Formatted Diff | Diff
Patch (1.60 KB, patch)
2015-07-21 11:07 PDT, Csaba Osztrogonác
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Csaba Osztrogonác 2015-06-12 04:03:58 PDT
../../Source/WebCore/platform/network/efl/NetworkStateNotifierEfl.cpp:138:75: warning: cast from 'char *' to 'struct nlmsghdr *' increases required alignment from 1 to 4 [-Wcast-align]
            nlh = ((length) -= ( (((nlh)->nlmsg_len)+4U -1) & ~(4U -1) ), (struct nlmsghdr*)(((char*)(nlh)) + ( (((nlh)->nlmsg_len)+4U -1) & ~(4U -1) )));
                                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Comment 1 Csaba Osztrogonác 2015-07-09 03:13:01 PDT
Source/WebCore/platform/network/efl/NetworkStateNotifierEfl.cpp:138
--------------------------------------------------------------------
nlh = NLMSG_NEXT(nlh, length);

---
NLMSG_NEXT is defined in /usr/include/linux/netlink.h system header,
which guarantees proper alignment, so we should simply suppress it here.

#define NLMSG_NEXT(nlh,len)      ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
                                  (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))

#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
Comment 2 Csaba Osztrogonác 2015-07-09 03:15:16 PDT
Created attachment 256477 [details]
Patch
Comment 3 Csaba Osztrogonác 2015-07-21 11:07:21 PDT
Created attachment 257186 [details]
Patch
Comment 4 WebKit Commit Bot 2015-07-22 09:09:23 PDT
Comment on attachment 257186 [details]
Patch

Clearing flags on attachment: 257186

Committed r187160: <http://trac.webkit.org/changeset/187160>
Comment 5 WebKit Commit Bot 2015-07-22 09:09:26 PDT
All reviewed patches have been landed.  Closing bug.