generator: fix signed comparison for gcc