Can Aliasing Problems be Avoided with const Variables
问题 My company uses a messaging server which gets a message into a const char* and then casts it to the message type. I've become concerned about this after asking this question. I'm not aware of any bad behavior in the messaging server. Is it possible that const variables do not incur aliasing problems? For example say that foo is defined in MessageServer in one of these ways: As a parameter: void MessageServer(const char* foo) Or as const variable at the top of MessageServer : const char* foo =