I'm introducing new types in my program, such as tileno_i
, pageno_i
and blockno_u
where I used to have only int
or unsigned
, the idea being to communicate more clearly what sort of value a function takes or returns.
I had hope to use g++'s -Wconversion
flag to spot places where some local variables should be converted to the new types as well, but I end up with lots of situations requiring useless casting, such as
for (tileno_i i = 0 ; i < size(); i += 4) {
// ^
// warning: conversion to tileno_i {aka short unsigned int} from 'int' may alter its value
Is there a flag similar to Wconversion
that would let me catch errors without going to assume that things are automatically promoted to int
s as soon as I do arithmetic on them?