This is an archive of the discontinued LLVM Phabricator instance.

Fix LLDB ARM build error on ubuntu precise with gcc4.7
ClosedPublic

Authored by omjavaid on Apr 19 2015, 3:58 PM.

Details

Summary

LLDB Arm build fails on ubuntu precise with gcc4.7 with following error

error: case value evaluates to 4283649346, which cannot be narrowed to type 'int' [-Wc++11-narrowing]

The compiler fails to store #define CIFS_MAGIC_NUMBER 0xFF534D42 into a singed int value as in statfs.h the type is being declared as int .

To work around this issue we type cast type value into an unsigned int.

This is safe as type is dependent on the actual 4 byte value stored in it rather than the sign.

Diff Detail

Event Timeline

omjavaid updated this revision to Diff 23996.Apr 19 2015, 3:58 PM
omjavaid retitled this revision from to Fix LLDB ARM build error on ubuntu precise with gcc4.7.
omjavaid updated this object.
omjavaid edited the test plan for this revision. (Show Details)
omjavaid added a subscriber: Unknown Object (MLST).
tberghammer accepted this revision.Apr 20 2015, 2:29 AM
tberghammer edited edge metadata.

LGTM

This revision is now accepted and ready to land.Apr 20 2015, 2:29 AM

Please add the review link to the commit message with the following syntax (see examples in the git log):

Differential revision: http://reviews.llvm.org/D9100
This revision was automatically updated to reflect the committed changes.