I agree that you must bite the bullet and fix the code in order to use the correct integer type. But to answer your question: No , you cannot turn it off, although you can get around it.
Many errors come from warnings. A good thing at all, but if you want to turn off the warning, just do it. Since the culprit is probably something like -Wall , which allows a lot of warnings that you must continue, you must selectively disable this one warning. The error message refers to the diagnostics responsible for the error message, for example. ... [-Wextra-tokens] (if not, remove the -fno-diagnostics-show-option flag). You can completely disable this diagnostic by adding -Wno-extra-tokens (again, the warning โextra token signsโ) or turn it into a non-fatal warning using -Wno-error=extra-tokens .
However, this particular error is not caused by a warning, and I cannot find any option to disable errors (it makes sense, since most errors are fatal).
But just truncate the integer value and not fix all the misuse of uint32_t so far you can use static_cast<uint32_t>(reinterpret_cast<uintptr_t>(ptr)) . Needless to say, this would still be a mistake.
delnan
source share