]> granicus.if.org Git - re2c/commit
Explicit cast of pointer difference to uint32_t: it seems to be safe from the code.
authorUlya Trofimovich <skvadrik@gmail.com>
Mon, 10 Aug 2015 09:32:31 +0000 (10:32 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Mon, 10 Aug 2015 09:44:42 +0000 (10:44 +0100)
commit46c5baeae0d3b23f6c2468905a009dd18efd0e11
treeb70132b6c087fd667317c8fc728f7772ce46bd02
parent09fde6595a8882ed35d89511be43e204e3ac997c
Explicit cast of pointer difference to uint32_t: it seems to be safe from the code.

In theory, this function returns the number of 'Span's in the newly
constructed 'Span' array, so it must be a non-negative integer number
that fits into 32 bits and the cast is safe.

In practice, 'x0' variable stays unchanged in this function, while
'x' variable's value can only increase: whenever it can be (conditionally)
decremented, it is always unconditionally incremented. So 'x - x0'
must be non-negative.

Fixes [-Wconversion] warning.
re2c/src/codegen/prepare_dfa.cc