Porting - Different operating system, compiler, and behavior

来源:互联网 发布:java遍历字符串数组 编辑:程序博客网 时间:2024/05/17 05:01
These days I am working on project porting to Mac, which is a Unix-like platform with GCC as the default compiler.

Besides some basic language grammer issues, what we need to care more are API semantic differences, compiler behaviors..
For example, there're some APIs not existed on Mac while Windows offers, or Mac contains a totally different view toward some issue comparing against Windows.And another more complex issue is about compiler, gcc may perform totally different with ms'. In one situation I met yesterday, gcc would cache the compiled binary code and when it
met the same named class in another compiling unit, it will put the cached one into it directly, which may be presumptuous and so cause bugs.

While on the contrary, you could believe what STD does on different platforms because it is protected  by standard, if anything behaves differently, you can sue the producer :P