用QT5編譯QT4的工程,這個數4323168000,由long int 轉換為 float轉換錯誤。
narrowing conversion of '4323168000' from 'long int' to 'float' inside { }
翻譯:4323168000由long int轉換為float 會有收縮的轉換
這個錯誤有C++11 narrowing 檢測並報告
類似的有:error: constant expression evaluates to 1583035200 which cannot be narrowed to type 'float' (在一個float數組中,定義了0xffffffff 1583035200 )
note: insert an explicit cast to silence this issue
轉換為float后,會不准確,對於一個costant常數,是不被允許的。可以加強制轉換(顯示轉換)static_cast<float>。
即:{0, static_cast<float>(4294967295U), static_cast<float>(1583035200U)}