cast to 'void *' from smaller integer type 'int'
By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide, "what happen when typcating normal variable to void* or any pointer variable?" This code is a bit odd (but a void* can certainly host a int on all architectures on which GDAL can be compiled), and certainly unused by anyone, so you could just remove the GetInternalHandle () implementation as well if you prefer. @ck_ I didn't realize the error in the question is actually an error by default, not a warning-turned-error. Not the answer you're looking for? Even if you are compiling your program for a 32-bit computer, you should fix your code to remove these warnings, to ensure your code is easily portable to 64-bit. Just because you're altering. . I think that's what you want: // Declaration uint8_t *myData; void loop () { myData = "custom string"; } Use returnPtr[j] = (void *) ((long)ptr + i); ). EXP36-C. Do not cast pointers into more strictly aligned pointer types @DavidHeffernan, sane thread APIs wouldn't send integral data to the thread procedures, they would send pointers. arrays - I get the error: "cast to smaller integer type 'int' from Which ability is most related to insanity: Wisdom, Charisma, Constitution, or Intelligence? Windows has 32 bit long only on 64 bit as well. For reference types, an explicit cast is required if you need to convert from a base type to a derived type: A cast operation between reference types does not change the run-time type of the underlying object; it only changes the type of the value that is being used as a reference to that object. If the sizes are different then endianess comes into play. The problem is not with casting, but with the target type loosing half of the pointer. Explicit conversions (casts): Explicit conversions require a cast expression. The error message mentions the diagnostic responsible for error message, e.g.
4lo Blinking And Check Engine Light Prado,
Cazoo Advert Voice Actor,
Articles C