// OK: lvalue denoting the original d object, // UB: the b subobject is not a base class subobject, // 6. array-to-pointer followed by upcast, https://en.cppreference.com/mwiki/index.php?title=cpp/language/static_cast&oldid=147983, when converting a 'pointer to object' to 'pointer to, the conversion from floating-point values, the conversion from bit-fields to rvalue references, the conversion from integral or enumeration values to enumeration, the conversion from integral or enumeration values to, the conversion from a member of base class type to, a standard-layout class object with no data members, a non-standard-layout union object and a non-static data, for base-to-derived pointer conversions and, the conversion to enumeration types with fixed underlying type, a standard-layout class might have a non-pointer-interconvertible, If the underlying type is not fixed, the behavior is undefined if the value of, If the underlying type is fixed, the result is the same as, one is a union object and the other is a non-static data member of that object, or. Press question mark to learn the rest of the keyboard shortcuts. I need to convert the argument to an int for later use: The compiler (GCC version 4.2.4) returns the error: You can cast it to an intptr_t type. If you do this, you have the thread reference a value that (hopefully still) lives in some other thread. Visit Microsoft Q&A to post new questions. I'm trying to learn pthreads and thing that keeps bugging me is how do i really pass argument to the function. Mutually exclusive execution using std::atomic? So make sure you understand what you are doing! Please unaccept the answer you have chosen as it is wrong (as the comments below it say) and will lead to bugs. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. What Is the Difference Between 'Man' And 'Son of Man' in Num 23:19? See also this documentation.. From and Into are generally intended to be lossless, infalliable conversions.as on the other hand can discard data and lead to bugs in some situations, for example casting a u64 to a usize may truncate the value on a 32-bit host. Only the following conversions can be done with static_cast, except when such conversions would cast away constness or volatility. Notifications. How do I work around the GCC "error: cast from SourceLocation* to int loses precision" error when compiling cmockery.c? The code ((void*)ptr + 1) does not work, because the compiler has no idea what size "void" is, and therefore doesn't know how many bytes to add. ^~~~~~~~~~~~~~~~~~~~ It is purely a compile-time directive which instructs the compiler to treat expression as if it had . Thanks for contributing an answer to Stack Overflow! even though the compiler doesn't know you only ever pass myFcn to pthread_create in conjunction with an integer. Yesterday, I updated Xcode to the newest version (5.1 (5B130a)) to compatible with iOS 7.1. @LearnCocos2D: so, how can i "overcome" the error without editing any not-my-code or in-library-file lines? "After the incident", I started to be more careful not to trip over things. Type casting is when you assign a value of one primitive data type to another type. Euler: A baby on his lap, a cat on his back thats how he wrote his immortal works (origin?). A long long would not work for 32bit systems and a long would not work for 64 bit Windows (while 64bit Unix and Unix-like systems like OS X use the LP64 data model, in which a long is 64bit, 64bit Windows uses the LLP64 data model, in which a long has a size of 32bit (http://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models)). Use #include to define it. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. ../lib/odp-util.c:5658:9: note: expanded from macro 'SCAN_END_SINGLE' I'm using cocos2d-x-2.2.2. The high-order 9 bits of the number are used to hold a flag value, and the result is converted back into a pointer. error: cast from pointer to smaller type 'unsigned int' loses information. Put your define inside a bracket: without a problem. 10) A prvalue of type pointer to void (possibly cv-qualified) can be converted to pointer to any object type. If the source type is bool, the value false is converted to zero and the value true is converted to the value one of the destination type (note that if the destination type is int, this is an integer promotion, not an integer conversion). 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. */void **MatrixIB (unsigned long x, unsigned long y, int size){ void *ptr; void **returnPtr; register unsigned long i, j; Have a question about this project? Basically its a better version of (void *)i. The nature of simulating nature: A Q&A with IBM Quantum researcher Dr. Jamie We've added a "Necessary cookies only" option to the cookie consent popup. Not the answer you're looking for? BUT converting a pointer to void* and back again is well supported (everywhere). reinterpret_cast<void *>(42)). Issues. void* -> integer -> void* rather than integer -> void* -> integer. To learn more, see our tips on writing great answers. You just need to suppress the warning, and this will do it: This may offend your sensibilities, but it's very short and has no race conditions (as you'd have if you used &i). As a result of the integer division 3/2 we get the value 1, which is of the int type. Any expression can be cast to type void (which means that the result of the expression is ignored), but it's not legal to cast an expression of type void to type int not least because the result of such a cast wouldn't make any sense. Please note that the error I am receiving is "cast to smaller integer type 'int' from 'string' (aka 'char *')" referencing line of code: while (isalpha(residents[i].name) == 0). It's an int type guaranteed to be big enough to contain a pointer. warning C4311: 'type cast': pointer truncation from 'void *' to 'long' in ECPG test files. Did any DOS compatibility layers exist for any UNIX-like systems before DOS started to become outmoded? /** Dynamically allocate a 2d (x*y) array of elements of size _size_ bytes. It was derived from the BCPL, and the name of the b language is possibly from the BCPL contraction. The reinterpret_cast makes the int the size of a pointer and the warning will stop. The problem just occur with Xcode 5.1. whether it was an actual problem is a different matter though. A void pointer can be really useful if the programmer is not sure about the data type of data inputted by the end user. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. Windows has 32 bit long only on 64 bit as well. The pointer doesn't actually point to anything, but it's the result of an earlier cast from an integer to a pointer (e.g. The proper way is to cast it to another pointer type. Then i can continue compiling. . (Also, check out how it prints "5" twice), passing a unique pointer to each thread wont race, and you can get/save any kind of information in the th struct. The difference between the phonemes /p/ and /b/ in Japanese. A cast converts an object or value from one type to another. If the original type is a void *, converting to an int may lose date on platforms where sizeof(void *) != sizeof(int) (which is true of LP64 programming model). Please tell me error: cast from 'void*' to 'int' loses precision, How Intuit democratizes AI development across teams through reusability. should we also have a diagnostic for the (presumed) user error? What is the purpose of non-series Shimano components? The calculated expression consists of two operations. I would create a structure and pass that as void* to pthread_create. From that point on, you are dealing with 32 bits. You are getting warnings due to casting a void* to a type of a different size. Use returnPtr[j] = (void *) ((long)ptr + i); ). Just want to point out that the purpose of threads is, +1 absolutely true, but if you take you time to write struct {}, you can save a lot of troubles in the future when you want to receive/send more data then just an int. (int*)Pc = pa; After the execution of the above code all the three pointers, i.e., Pa, Pd, and Pc, point to the value 150. ../lib/odp-util.c:5834:5: error: cast to smaller integer type 'unsigned long' from 'void *' [-Werror,-Wvoid-pointer-to-int-cast] SCAN_SINGLE("skb_priority(", uint32_t, u32, OVS_KEY_ATTR_PRIORITY); returnPtr = (void **) malloc (x * sizeof(void *)); ptr = (void *) malloc (x * y * size); It is easier to understand and write than any other assembly language. this way you won't get any warning. C99 standard library provides intptr_t and uintptr_t typedefs, which are supposed to be used whenever the need to perform such a cast comes about. Fork 63. Hence there is no loss in data. Put your define inside a bracket: #define M_TABLE_SIZE (64*1024) Now, you can do: static const void* M_OFFSET = (void*) M_TABLE_SIZE; without a problem. STR34-C. This is known as implicit type casting or type promotion, compiler automatically converts smaller data type to larger data type. The value of float variable is= 37.75. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. What is the point of Thrower's Bandolier? Returns a value of type new-type. GitHub Skip to content Product Solutions Open Source Pricing Sign in Sign up smadaminov / ovs-dpdk-meson-issues Public Notifications Fork 1 Star 1 Code Issues 66 Pull requests Actions Projects 1 Security Insights New issue x is a local variable and its lifetime ends as soon as control leaves the scope it was defined in. rev2023.3.3.43278. Do new devs get fired if they can't solve a certain bug? (void *)i Error: cast to 'void *' from smaller integer type 'int'. A cast specifies a conversion from one type to another. Error while setting app icon and launch image in xcode 5.1. A cast is a way of explicitly informing the compiler that you intend to make the conversion and that you are aware that data loss might occur, or the cast may fail at run time. All character types are to be converted to an integer. To learn more, see our tips on writing great answers. *sound/soc/codecs/tlv320aic32x4.c:1202:18: warning: cast to smaller integer type 'enum aic32x4_type' from 'void *' @ 2022-04-22 9:48 kernel test robot 0 siblings, 0 . Does Counterspell prevent from any further spells being cast on a given turn? Staging Ground Beta 1 Recap, and Reviewers needed for Beta 2. what does it mean to convert int to void* or vice versa? ", "? Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide. Casting arguments inside the function is a lot safer. Well it does this because you are converting a 64 bits pointer to an 32 bits integer so you loose information. rev2023.3.3.43278. cast operators [edit] When an expression is used in the context where a value of a different type is expected, conversionmay occur: intn =1L;// expression 1L has type long, int is expectedn =2.1;// expression 2.1 has type double, int is expectedchar*p =malloc(10);// expression malloc(10) has type void*, char* is expected Why is there a voltage on my HDMI and coaxial cables? equal to the original pointer: First you are using a define, which is not a variable. then converted back to pointer to void, and the result will compare Sign up for a free GitHub account to open an issue and contact its maintainers and the community. What video game is Charlie playing in Poker Face S01E07? B programing language is a language based on basic combined programming or a BCPL, and it is the precursor of the C programming language. Just re-enforcing the old behavior of Xcode 5.0 and earlier versions, that already cut away parts of the address by casting it to int, won't introduce any new bugs and avoids the need to learn and understand lots of implementation-internal cocos code. However, you are also casting the result of this operation to (void*). this way I convert an int to a void* which is much better than converting a void* to an int. I don't see how anything bad can happen . casting from int to void* and back to int. To be honest, I think, clang is too restrictive here. How to tell which packages are held back due to phased updates, Identify those arcade games from a 1983 Brazilian music video. Note:You might receive a runtime exception if the pointer contains a value unsuitable for the context. To learn more, see our tips on writing great answers. It is done by the compiler on its own, without any external trigger from the user. You may declare a const int variable and cast its reference to the void*. This allows you to reinterpret the void * as an int. From the question I presume the OP does. So,solution #3 works just fine. How can this new ban on drag possibly be considered constitutional? Now, what happens when I run it with the thread sanitizer? Connect and share knowledge within a single location that is structured and easy to search. Where does this (supposedly) Gibson quote come from? Casting an open pointer to other pointer types and casting other pointer types to an open pointer does not result in a compile time error. There is absolutely not gurantee that sizeof(int) <= sizeof(void*). rev2023.3.3.43278. Find centralized, trusted content and collaborate around the technologies you use most. What is the correct method to cast an int to a void*? You can convert the values from one type to another explicitly using the cast operator as follows (type_name) expression The nature of simulating nature: A Q&A with IBM Quantum researcher Dr. Jamie We've added a "Necessary cookies only" option to the cookie consent popup. pthread passes the argument as a void*. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. Update: Today, i download the latest version of cocos2d-x (cocos2d-x 2.2.3). Staging Ground Beta 1 Recap, and Reviewers needed for Beta 2. The nature of simulating nature: A Q&A with IBM Quantum researcher Dr. Jamie We've added a "Necessary cookies only" option to the cookie consent popup. Therefore, you need to change it to long long instead of long in windows for 64 bits. But this code pass the normal variable .. If you convert (void*) to (long) no precision is lost, then by assigning the (long) to an (int), it properly truncates the number to fit. B language was designed to develop . Why is there a voltage on my HDMI and coaxial cables? For example, if you want to store a 'long' value into a simple integer then you can type cast 'long' to 'int'. SCAN_PUT_ATTR(key, ATTR, skey, FUNC); . pthread create managing values generated in function (in c), Establishing TCP socket connection between PHP client and C server on Ubuntu. What I am trying to do in that line of code is check to make sure each character in my string is alphabetical. Functions return bigint only if the parameter expression is a bigint data type. In Java, there are two types of casting: Widening Casting (automatically) - converting a smaller type to a larger type size. If pointers are 64 bits and ints are 32 bits, an int is too small to hold a pointer value. ERROR: incompatible integer to pointer conversion assigning to 'string' (aka 'char *') from 'int', error: cast to 'string' (aka 'char *') from smaller integer type 'int' [-Werror,-Wint-to-pointer-cast], error: incompatible integer to pointer conversion assigning to 'string' (aka 'char *') from 'int' C, warning: initialization of 'unsigned char' from 'uint8_t *' {aka 'unsigned char *'} makes integer from pointer without a cast [-Wint-conversion], Minimising the environmental effects of my dyson brain. But the problem has still happened. Before I update Xcode, my project still can build and run normally with all devices. ../lib/odp-util.c:5601:9: note: expanded from macro 'SCAN_PUT' vegan) just to try it, does this inconvenience the caterers and staff? The preprocesor absolutely will not perform arithmetic. rev2023.3.3.43278. Using an integer address (like &x) is probably wrong, indeed each modification you will execute on x will affect the pass behaviour. Bulk update symbol size units from mm to map units in rule-based symbology. I have a two functions, one that returns an int, and one that takes a const void* as an argument. Casting int to void* loses precision, and what is the solution in required cases, c++: cast from "const variable*" to "uint32" loses precision, Recovering from a blunder I made while emailing a professor, Relation between transaction data and transaction id. Find centralized, trusted content and collaborate around the technologies you use most. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cast to 'double *' from smaller integer type 'unsigned int' The C compiler is gcc, clang version 3.9.1, target aarch64--linux-android, thread model posix. In both cases, converting the pointer to an integer type that's too small to represent all pointer values is a bug. Can I tell police to wait and call a lawyer when served with a search warrant? vegan) just to try it, does this inconvenience the caterers and staff? If the value is ever used as pointer again that will prove to be an extremely bad idea. The nature of simulating nature: A Q&A with IBM Quantum researcher Dr. Jamie We've added a "Necessary cookies only" option to the cookie consent popup. Whats the grammar of "For those whose stories they are"? Why did Ukraine abstain from the UNHRC vote on China? You are just making it bigger by tricking the compiler and the ABI. How to get the error message from the error code returned by GetLastError()? If this is the data to a thread procedure, then you quite commonly want to pass by value. Do roots of these polynomials approach the negative of the Euler-Mascheroni constant? In such condition type conversion (type promotion) takes place to avoid loss of data. To cast such pointers to 32-bit types and vice versa special functions are used: void * Handle64ToHandle ( const void * POINTER_64 h ) void * POINTER_64 HandleToHandle64 ( const void *h ) long HandleToLong ( const void *h ) unsigned long HandleToUlong ( const void *h ) If you are planning to use pthreads and you are planning to pass the pass function to pthread_create, you have to malloc/free the arguments you are planning to use (even if the threaded function just need a single int). By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. The text was updated successfully, but these errors were encountered: You signed in with another tab or window. unsigned long call_fn = (unsigned long)FUNC; If you call your thread creation function like this, then the void* arriving inside of myFcn has the value of the int you put into it. The nature of simulating nature: A Q&A with IBM Quantum researcher Dr. Jamie We've added a "Necessary cookies only" option to the cookie consent popup. Create an account to follow your favorite communities and start taking part in conversations. Connect and share knowledge within a single location that is structured and easy to search. How to use Slater Type Orbitals as a basis functions in matrix method correctly? But then you need to cast your arguments inside your thread function which is quite unsafe cf. Get the address of a callback function to call dynamically in C++, error: call of overloaded function ambiguous, error: cast from to unsigned int loses precision [-fpermissive]. There's no proper way to cast this to int in general case. Projects. and how to print the thread id of 2d array argument? You should perform type conversion based on 64bit build system because the type "int" supports only -32768 ~ 32768. The preprocessor will replace your code by this: This is unlikely what you are trying to do. Remarks. This solution is in accordance with INT18-C. How Intuit democratizes AI development across teams through reusability. Otherwise, if the original pointer value points to an object a, and there is an object b of the . @DietrichEpp can you explain what is race condition with using. Why do academics stay as adjuncts for years rather than move around? Find centralized, trusted content and collaborate around the technologies you use most. Why is there a voltage on my HDMI and coaxial cables? This is memory reinterpretation - a completely unacceptable way to do what the OP is trying to do. The difference between the phonemes /p/ and /b/ in Japanese, Styling contours by colour and by line thickness in QGIS, AC Op-amp integrator with DC Gain Control in LTspice, Identify those arcade games from a 1983 Brazilian music video. Making statements based on opinion; back them up with references or personal experience. I need to cast the int from the first function so that I can use it as an argument for the second function. It generally takes place when in an expression more than one data type is present. Surely the solution is to change the type of ids from int to type that is sufficiently large to hold a pointer. Yeah, the tutorial is doing it wrong. Why is this sentence from The Great Gatsby grammatical? If that happens soon after the call to pthread_create() then you have a race condition, because there's a chance that the thread will attempt to read x's value after it's life has ended, which invokes undefined behavior. eg. Does a summoned creature play immediately after being summoned by a ready action? The mapping in pointer<->integer casts is implementation defined, but the intent was that if the pointer type is large enough and isn't forcefully aligned (, But that's different. FAILED: lib/libopenvswitch.a.p/odp-util.c.obj (i.e. @Artelius: Which, presumably, is exactly what Joshua did: A C++ reinterpret cast will not solve the problem. Remembering to delete the pointer after use so that we don't leak. You need to pass an actual pointer. ../lib/odp-util.c:5603:13: note: expanded from macro 'SCAN_PUT' Find centralized, trusted content and collaborate around the technologies you use most. Converting a pointer to an integer whose result cannot represented in the integer type is undefined behavior is C and prohibited in C++. Such a downcast makes no runtime checks to ensure that the object's runtime type is actually D, and may only be used safely if this precondition is guaranteed by other means, such as when implementing static polymorphism. There are ways to prevent this: pass a dynamic allocated argument if your not the passing thread is not static or if your argument is a local variable, otherwise there is no issue. Identify those arcade games from a 1983 Brazilian music video, Relation between transaction data and transaction id, The difference between the phonemes /p/ and /b/ in Japanese. I am an entry level C programmer. To access the object value, use the * dereference operator: int * p; assert (p == null ); p = new int (5); assert (p != null ); assert (*p == 5); (*p)++; assert (*p == 6); If a pointer contains a null value, it is not pointing to a valid object. lexborisov Modest Public. How do I align things in the following tabular environment? This is an old C callback mechanism so you can't change that. If you preorder a special airline meal (e.g. this question. Is it plausible for constructed languages to be used to affect thought and control or mold people towards desired outcomes? My code is GPL licensed, can I issue a license to have my code be distributed in a specific MIT licensed project? But you seem to suggest by your answer that the user can pass 5 to pthread_create and then perform the above cast to get it back. a is of type int[4], which can be implicitly cast to int* (ie, a pointer to an int) &a is of type int(*)[4] (ie: a pointer to an array of 4 ints). } SCAN_END_SINGLE(ATTR) But assuming that it is, as long as the caller and the callee agree, you can do that sort of thing. What is the point of Thrower's Bandolier? Difficulties with estimation of epsilon-delta limit proof. So the compiler is very picky here and the correct solution to make the code compile again and still let it show the exact same behavior like in Xcode 5.0 is to first cast to an integer type with a size that matches the one of a pointer and to then do a second cast to the int that we actually want: ids [i] = (int) (size_t)touch; you can pass the int value as void pointer like (void *)&n where n is integer, and in the function accept void pointer as parameter like void foo (void *n); and finally inside the function convert void pointer to int like, int num = * (int *)n;. A sane compiler may throw a warning on lines like this but by no way it should throw an error, because this code is NOT wrong, it is just potentially error-prone, but can be perfectly valid. SCAN_PUT(ATTR, NULL); ^~~~~~~~~~~~~~~~~~~~ Is it plausible for constructed languages to be used to affect thought and control or mold people towards desired outcomes? I cannot reverse my upvote of user384706's answer, but it's wrong. It is commonly called a pointer to T and its type is T*. Pd = Pa; Similarly, Pc may be type cast to type int and assigned the value Pa. 1. Thanks Jonathan, I was thinking about my answer in another thread: AraK is correct, passing integers a pointers are not necessarily interchangeable. The best way is, if one can, do not do such casting, instead, if the same memory address has to be shared for pointer and int (e.g. Referring to N1570 7.20.1.4/p1 (Integer types capable of holding object pointers): The following type designates a signed integer type with the property To subscribe to this RSS feed, copy and paste this URL into your RSS reader. "I think what you should do is actually pass the address of the variable to the function" Not necessarily. In the case of Widening Type Casting, the lower data type (having smaller size) is converted into the higher data type (having larger size). a cast of which the programmer should be aware of what (s)he is doing. Is pthread_join a must when using pthread in linux? Can I tell police to wait and call a lawyer when served with a search warrant? The correct answer is, if one does not mind losing data precision. I get the error: "cast to smaller integer type 'int' from 'string' (aka 'char *')" referencing line of code: while (isalpha(residents[i].name) == 0), How Intuit democratizes AI development across teams through reusability. actually no, as int my be a smaller type than a pointer ;-) But, of course with int64_t it works fine. Most answers just try to extract 32 useless bits out of the argument. The subreddit for the C programming language, Press J to jump to the feed. linux c-pthreads: problem with local variables. Sign in It's always a good practice to put your #define's in brackets to avoid such surprise. "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-g" "-Wthread-safety" "-Wno-microsoft-enum-forward-reference" "-Wno-unused-function" "-Wno-sometimes-unini If your standard library (even if it is not C99) happens to provide these types - use them. There's no proper way to cast this to int in general case. ^~~~~~~~~~~~~~~~~~~~~ By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. This page was last modified on 12 February 2023, at 18:25. "clang" "-Ilib\libopenvswitch.a.p" "-Ilib" "-I..\lib" "-I." I'm unfamiliar with XCode, but the solution should be something like follows: Most of the "solutions" above can lose part of the pointer address when casting to a smaller type. Example: int x=7, y=5; float z; z=x/y; /*Here the value of z is 1*/. In such a case the programmer can use a void pointer to point to the location of the unknown data type. Asking for help, clarification, or responding to other answers. There exist two main syntaxes for generic type-casting: functional and c-like: 1 2 3 4 double x = 10.3; int y; y = int (x); // functional notation y = (int) x; // c-like cast notation The functionality of these generic forms of type-casting is enough for most needs with fundamental data types. This will get you a pointer from a 32 bit offset: A function pointer is incompatible to void* (and any other non function pointer). My code is all over the place now but I appreciate you all helping me on my journey to mastery! static const void* M_OFFSET = (void*)64*1024; Since gcc compiles that you are performing arithmetic between void* and an int ( 1024 ). @kshegunov said in Number Type Cast: const void * x; int y = int (x); compiles just fine. That's not a good idea if the original object (that was cast to void*) was an integer. Staging Ground Beta 1 Recap, and Reviewers needed for Beta 2, Xcode 5 and iOS 7: Architecture and Valid architectures, xcode build error: Semantic issue cast from pointer to smaller type 'int' loses information, Issues in handling touches on subviews(uiviews) in UIScrollView, Architecture linking error after Xcode 5.1 upgrade, iOS 7.1 gives error after updating to Xcode 5.1, Linker error in Xcode 5.1 with cocos2d-x 3 beta 2. To learn more, see our tips on writing great answers. Since gcc compiles that you are performing arithmetic between void* and an int (1024). But I don't want to edit code in "EAGLView.mm" because it's a "library file". However, I believe that even if the define was for the "65536", it would not be what @kaetzacoatl wanted. Is a PhD visitor considered as a visiting scholar. Typically, long or unsigned long is . This is not even remotely "the correct answer". Already on GitHub? No idea how it amassed 27 upvotes?! Safe downcast may be done with dynamic_cast. Don't do that. Offline ImPer Westermark over 11 years ago in reply to Andy Neil Except that you sometimes stores an integer in the pointer itself. It solved my problem too. How to correctly cast a pointer to int in a 64-bit application? You are getting warnings due to casting a void* to a type of a different size. Terrible solution. byte -> short -> char -> int -> long -> float -> double. ^~~~~~~~~~~~~~~~~~~~~
Dazzling Cleaning Customer Service, Articles C