| ??? 04/22/03 14:45 Read: times |
#43926 - RE: Universal casting to structs/union/void Responding to: ???'s previous message |
#define CAST(new_type,old_object) (*((new_type *)&old_object))
... found on the internet used in a linux project ... Intuitively, you would expect a compiler to resolve this down to some form of direct addressing -- and most compilers do just that. I have run across compilers that generate code to access the data objects using indirect addressing, so if you have any concerns about performance, it's best to check the compiler-generated code for this. But then, if one was concerned about performance, one would be writing in assembly anyway, right? |
| Topic | Author | Date |
| Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| Universal casting to structs/union/void | 01/01/70 00:00 | |
RE: Universal casting to structs/union/void | 01/01/70 00:00 |



