Bug 145915

Summary: Fix cast-align warning in NetworkStateNotifierEfl.cpp
Product: WebKit Reporter: Csaba Osztrogonác <ossy>
Component: New BugsAssignee: Csaba Osztrogonác <ossy>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ossy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 145121    
Attachments:
Description Flags
Patch
none
Patch none

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.