Standard says you can convert any pointer to void* and back without loosing data.I don't know what the standard says
No garantees for over pointer conversions
Standard says you can convert any pointer to void* and back without loosing data.I don't know what the standard says
No garantees for over pointer conversions
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
The size of a pointer is not defined by the standard. Standard C or C++, on just x86 architectures, can have 16, 32, 64 or 48 bit pointers, for example. 16-bit pointers are used in small real-mode, where the entire application can fit in 64KB. 32-bit pointers are used in "large" real-mode and 32-bit flat model. 64-bit pointers are obviously in X86-64 mode. 48-bit pointers would be if you use segmented mode with 32-bit pointers, and there are compilers that use that mode, although I do admit that you will be looking into the smaller markets of specialized embedded compilers, and not gcc or MS based compilers.
In other architectures, we also have pointer systems where a pointer has to be aligned to 32 bits, and bytes are fetched via a supplementary value of "byte within word". So a pointer to int or function would hold only the 32-bit aligned pointer, where a char * would have a "byte-within-word" value stored along with the pointer. These aren't common machined, but I do believe that some older IBM machines are using this method.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Read that again carefully, I think you might see that it says something like "object pointers" or "pointer to type T."
You'll get a compiler diagnostic if you try to convert a function pointer to a void*.
For function pointers, I'm 99.999% sure that you can convert any function pointer to any other function pointer and back without loss. That's not guaranteed to be true for function pointer to void* and back. Sometimes function pointers can be quite a bit larger than void*. Particularly on Harvard-type architectures which, besides the size issue, use entirely different buses for data and code.
Last edited by whoie; 08-01-2008 at 02:46 AM.
Just got done reading this thread. Rule #6 does apply due to this:
IMO this shows ill intent and a desire to do harm to another computer system. You can claim it is for self defense but that is a old arguement in world history that rarely holds true for very long.
Yarin is also on thinner ground due to his previous history here at cboard.
If this thread stays on the current course of pointer sizes then it'll remain open, but if it reverts to the previous topic it will be closed.
>> IMO this shows ill intent and a desire to do harm to another computer system.
The program is a Zeroing-Out program, to delete sensitive data.
How do you come to the conclusion that I'm trying to hurt someone else's system? Sure, this method may be used in bad software, but if that's reason enough to paste a crook sticker on me, then we might as well stop using exes all together, after all, most viruses are exes.
>> Yarin is also on thinner ground due to his previous history here at cboard.
How? I've never been involved in any illegal stuff before. Only a personal opinion disagreement catastrophe.
Can mean and be interpreted many different ways. Due to your history I choose to interprete it on the more conservative side.Let's just say it's just suppose to prepare the computer for unwanted visitors.
Do you really want me to go into this in public Queatrix?How? I've never been involved in any illegal stuff before. Only a personal opinion disagreement catastrophe.
>> Do you really want me to go into this in public Queatrix?
Queatrix is an old handle, I prefer by my new one. Even so, please PM me anything you have to show that I was ever involved in viruses or anything related.
EDIT:
Better yet, go ahead and post it.
Last edited by Yarin; 08-02-2008 at 06:46 PM.
You can harm another system without using a virus. I didn't actually mention virus, you did.
Now from your behavior as Queatrix and the fact that you technically in violation of Rule 14 you don't get as much benefit of the doubt as other people.
And when I seeI immediately get suspicious.You're getting a little too nosy here.
If you disagree you are more then welcome to ask another mod to look it over and give their opinion. If you notice I haven't closed this thread, just warned against the orginal topic matter.