08/02/11 21:00:10
先に質問したものです。
iccについての質問なのですが、-Wall付きでコンパイルすると沢山警告がでます。
これらの警告は対応すべきなのでしょうか?
$ icc test.cpp -Wall
test.cpp(5): remark #1418: external function definition with no prior declaration
double g(double s) {
^test.cpp(6): remark #383: value copied to temporary, reference to temporary used return std::max(s - 100.0, 0.0);
test.cpp(6): remark #981: operands are evaluated in unspecified order return std::max(s - 100.0, 0.0);
ここで使っているソースはこれです。
#include <iostream>
using namespace std;
double g(double s) {
return std::max(s - 100.0, 0.0);
}
int main()
{
double x = 150.0;
cout << g(x) << endl;
return 0;
}