-ansi
このプログラムがフラグとフラグを使用しても GCC でコンパイルされる正当な理由はあり-pedantic
ますか?
#include <cmath>
int main (int argc, char *argv [])
{
double x = 0.5;
return static_cast<int>(round(x));
}
これにより、g++ -ansi -pedantic -Wall test.cpp -o test
.
2 つの問題があります。
round()
ISO 準拠モードの C++ では使用できないはずです (C99 に由来するため)。- この場合に利用可能であったとしても、名前空間
round()
からのみ利用可能であるべきですstd
私が間違っている?