bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++: finish propagating the unsigned->signed conversion in locations


From: Hans Åberg
Subject: Re: C++: finish propagating the unsigned->signed conversion in locations
Date: Tue, 29 Oct 2019 22:38:55 +0100

> On 29 Oct 2019, at 21:30, Akim Demaille <address@hidden> wrote:
> 
> +  In C++, line numbers and columns are now represented as 'int' not
> +  'unsigned', so that integer overflow on positions is easily checkable via
> +  'gcc -fsanitize=undefined' and the like.  This affects the API for
> +  positions.

There is std::streamoff for indicating file positions, it is signed, and can 
represent the maximum file size. By contrast, int can overflow on modern 64-bit 
computers.

https://en.cppreference.com/w/cpp/io/streamoff





reply via email to

[Prev in Thread] Current Thread [Next in Thread]