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

Some modern casting issues.. CBitmapPixelAccess::setPosition and itmapPixelAccess::operator++ #265

Open
GeorgeAAbraham1 opened this issue Aug 1, 2022 · 2 comments

Comments

@GeorgeAAbraham1
Copy link

cbitmap.h CBitmapPixelAccess::setPosition and itmapPixelAccess::operator++
Gives compiler error : currentPos = address + y * bytesPerRow;
Expectation, something like.. : currentPos = address + static_cast<__int64>(y) * bytesPerRow;

@scheffle
Copy link
Collaborator

Can you please add the complete compiler output and the compiler version when doing such a bug report. That would help enormously.

@GeorgeAAbraham1
Copy link
Author

Hi

Sure..

Microsoft Visual Studio Community 2022
Version 17.2.6
VisualStudio.17.Release/17.2.6+32630.192
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Community

Visual C++ 2022 00482-90000-00000-AA939
Microsoft Visual C++ 2022

This is covered in the C++ 17 book.. as a standard change.. it's not a bug.

exact compiler warnings:
Severity Code Description Project File Line Suppression State
Warning C26451 Arithmetic overflow: Using operator '' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '' to avoid overflow (io.2). SineSyn C:\Users\GeorgeAB.FSG\VST_SDK\vst3sdk\vstgui4\vstgui\lib\cbitmap.h 233
Warning C26451 Arithmetic overflow: Using operator '' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '' to avoid overflow (io.2). SineSyn C:\Users\GeorgeAB.FSG\VST_SDK\vst3sdk\vstgui4\vstgui\lib\cbitmap.h 246
Warning C26451 Arithmetic overflow: Using operator '' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '' to avoid overflow (io.2). SineSyn C:\Users\GeorgeAB.FSG\VST_SDK\vst3sdk\vstgui4\vstgui\lib\cbitmap.h 246

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