我在具有以下代码的项目中工作:extern const int z;do_some_stuff_to_calculate_x();do_some_stuff_with_y兴趣的焦点是file1.c中的划分。由于z是extern,所以在编译时不知道它将在链接时间中定义。所以编译器不能优化除法。
我知道,如果在编译时知道z的值,编译器将把除法转换为乘法和其他一些操作。请注意,file1.c将作为一个库交付,因此用file2.c</em
`x.so` was compiled from a cpp file with definitions of functions enclosed within `extern "C"`.A comment in the cpp file says that the usage of `extern "C"` is important but without further explanationSo is `extern "C&quo