Why doesn't g++ -Wconversion warn about conversion of double to long int when double is constant?
问题 If I pass a double to a function requiring long, g++ warns of conversion problem, but if I pass a const double to a function requiring long, g++ is happy. The warning is the following: warning: conversion to ‘long int’ from ‘double’ may alter its value [-Wconversion] I would like g++ to give me a warning whether I pass a double or a const double. How would I do so? I have makefile and some code you can run. I like to turn on as many warnings as I can, but perhaps one is implicitly shutting