阅读背景:

gcc优化、const静态对象和限制。

来源:互联网 

I'm working on an embedded project and I'm trying add more structure to some of the code, which use macros to optimize access to registers for USARTs. I'd like to organize preprocessor #define'd register addresses into const structures. If I define the structs as compound literals in a macro and pass them to inline'd functions, gcc has been smart enough the bypass the pointer in the generated assembly and hardcode the structure member values directly in the code. E.g.:I'm working on an embedded project and I'm tryi




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: