Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6622311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:23:22+00:00 2026-05-25T21:23:22+00:00

To generate UInt64 the following results in warning C4293: ‘<<‘ : shift count negative

  • 0

To generate UInt64 the following results in “warning C4293: ‘<<‘ : shift count negative or too big, undefined behavior”

UInt64 byteArrayToUInt64(int %stI, array<Byte>^ byteArray) {
    UInt64 retV = byteArrayToUInt32(stI, byteArray);
    retV |= byteArrayToUInt32(stI, byteArray) << 32;
    return retV;
}

or

UInt64 byteArrayToUInt64(int %stI, array<Byte>^ byteArray) {
    stI += 8;
    return byteArray[stI - 8] | byteArray[stI - 7]  << 0x08 |  byteArray[stI - 6]
     << 0x10 |  byteArray[stI - 5]  << 0x18 |  byteArray[stI - 4] << 0x20 |  byteArray[stI - 3]
     << 0x28 |  byteArray[stI - 2]  << 0x30 |  byteArray[stI - 1] << 0x38;
}

Unfortunately, all MS have to say about their UInt64 structure is:

The UInt64 value type represents unsigned integers with values ranging
from 0 to 18,446,744,073,709,551,615.

UInt64 provides methods to compare instances of this type, convert the
value of an instance to its string representation, and convert the
string representation of a number to an instance of this type.

Pretty useless isn’t it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:23:23+00:00Added an answer on May 25, 2026 at 9:23 pm

    Before shifting the value, you need to static_cast it to an UInt64. Otherwise you are shifting a 32 bit value by 32 positions, and that’s undefined behavior. Shifting a 64bit value by 32 positions is ok.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I generate an excel file using XML format outlined on stackoverflow in the following
I generate my check boxes dynamically: for (int i = 0; i < dtCommon.Count;
I generate an Excel using an SQL query per each day: SELECT COUNT(res_id) as
I generate a coverage.xml output file with the following command. C:\Program Files\NCover\NCover.Console.exe //reg //w
rails generate model User email:string password:string creates the following migration script class CreateUsers <
How can I generate random Int64 and UInt64 values using the Random class in
By generate, I mean auto-generation of the code necessary for a particular selected (set
We generate web pages that should always be printed in landscape mode. Web browser
We generate graphs for huge datasets. We are talking 4096 samples per second, and
I generate all my columns in a subclassed DataGridView programmatically. However Visual Studio 2008

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.