On 5 Feb 2015, at 07:48, Luigi Rizzo <ri...@iet.unipi.it> wrote:
> Rather than depending on a compiler option, wouldn't it be better/more
> robust to change ticks to unsigned, which has specified wrapping behavior?

Especially if we want to extend support for external toolchains.  gcc and clang 
support -fwrapv (though occasionally versions of both will not fully support 
it), but other compilers may well not have an equivalent.

Translating the code into C is a far more robust solution than the band-aid of 
telling the compiler to accept a language that is a bit like C and hoping that 
this will keep working across compiler implementations and versions.

Adding -fwrapv also defeats a number of compiler optimisations, so we are going 
to generate worse code for places where people used signed types correctly to 
work around places where they were used incorrectly.


freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to