Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shifting a negative signed value is undefined #49

Closed
lersek opened this issue Feb 3, 2016 · 2 comments
Closed

shifting a negative signed value is undefined #49

lersek opened this issue Feb 3, 2016 · 2 comments

Comments

@lersek
Copy link
Member

lersek commented Feb 3, 2016

@ajfish

cloned from #30 (comment)

It is compiler defined behavior in the older world, and that is why clang has added the warning. I also see the error in the base Tools as it has a case of shifting -1.

https://github.com/tianocore/edk2/blob/master/BaseTools/Source/C/Common/FvLib.c

//
// Get next file, compensate for 8 byte alignment if necessary.
//
*NextFile = (EFI_FFS_FILE_HEADER *) ((((UINTN) CurrentFile - (UINTN) mFvHeader + GetFfsFileLength(CurrentFile) + 0x07) & (-1 << 3)) + (UINT8 *) mFvHeader);
@lersek
Copy link
Member Author

lersek commented May 17, 2016

@ajfish
Copy link
Member

ajfish commented May 18, 2016

Thanks,

Andrew Fish

On May 17, 2016, at 6:55 PM, Liming Gao notifications@github.com wrote:

Closed #49 #49 via d3bb711 d3bb711.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub #49 (comment)

hwu25 pushed a commit that referenced this issue Jul 14, 2016
clang 3.8 flags -Wshift-negative-value warning, which turns fatal due to
use of -Werror.

Fixes: #49

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zenith432 <zenith432@users.sourceforge.net>
Reviewed-by: Liming Gao <liming.gao@intel.com>
(cherry picked from commit d3bb711)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants