小编Far*_*ley的帖子

更新OSX命令行工具6.3后缺少C++头<__ debug>

从App Store更新到命令行工具6.3后,包含<vector><iterator>内部包含<__ debug>的程序将导致文件未找到错误,如下所示.cpp没有什么有趣的,但包含在其中一个包含的标题中.

c++ -O3 -I/Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers -L/Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/build/binaries/clusterStaticLibrary /Users/farleylai/Documents/dev/git/ESMS/Optimizer/build/StreamIt/FIR/511/512/combined_threads.cpp -o streamit -lcluster -lpthread -lstdc++
In file included from /Users/farleylai/Documents/dev/git/ESMS/Optimizer/build/StreamIt/FIR/511/512/combined_threads.cpp:9:
In file included from /Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/node_server.h:22:
In file included from /Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/thread_info.h:20:
In file included from /Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/connection_info.h:19:
/Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/socket_holder.h:43:25: warning: delete called on 'mysocket' that is abstract but has non-virtual destructor
      [-Wdelete-non-virtual-dtor]
    if (!is_mem_socket) delete sock;
                        ^
In file included from /Users/farleylai/Documents/dev/git/ESMS/Optimizer/build/StreamIt/FIR/511/512/combined_threads.cpp:9:
In file included from /Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/node_server.h:22:
In file included from /Users/farleylai/Documents/dev/git/ESMS/Optimizer/../StreamIt/src/cluster/headers/thread_info.h:26:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/vector:265:
In file included from …
Run Code Online (Sandbox Code Playgroud)

c++ macos xcode stl clang

66
推荐指数
4
解决办法
1万
查看次数

clang和gcc之间的浮点运算结果不一致

在OSX 10.10和ubuntu 14.04上单独编译和运行.

#include<float.h>
#include<math.h>
#include<stdio.h>

void testAtan() {
  float temp1 = 62981764.0000000000000000f;
  float temp2 = (2.14859168E8f  *  atanf(temp1));
  printf("temp2: %.16f\n", temp2);
}

int main() {
  printf("FLT_EVAL_METHOD=%d\n", FLT_EVAL_METHOD);
  testAtan();
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

在OS X上,它会打印出来

FLT_EVAL_METHOD=0
temp2: 337499968.0000000000000000
Run Code Online (Sandbox Code Playgroud)

在ubuntu上,它打印出来

FLT_EVAL_METHOD=0
temp2: 337500000.0000000000000000
Run Code Online (Sandbox Code Playgroud)

任何想法证明这一点以及如何使结果保持一致?

c floating-point gcc clang

0
推荐指数
1
解决办法
786
查看次数

标签 统计

clang ×2

c ×1

c++ ×1

floating-point ×1

gcc ×1

macos ×1

stl ×1

xcode ×1