[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: checked integer arithmetic
From: |
Bruno Haible |
Subject: |
Re: checked integer arithmetic |
Date: |
Fri, 16 Dec 2016 01:02:18 +0100 |
User-agent: |
KMail/4.8.5 (Linux/3.8.0-44-generic; KDE/4.8.5; x86_64; ; ) |
> For this purpose, it would be good if GCC had a type, say, __gcc_index_t,
> that -fsanitize=undefined will make produce a diagnostic is a value < 0
> or > PTRDIFF_MAX is assigned.
Actually, this is a special case of a range type. If we could have Ada's range
types [1] in C, with overflow check enabled by -ftrapv or -fsanitize=undefined,
that would be a *great* improvement. Especially as many GNU packages use
C as an application programming language rather than as a system programming
language.
Bruno
[1] https://en.wikibooks.org/wiki/Ada_Programming/Types/range
- FYI: dfa: add an assertion to avoid coverity false positive, Jim Meyering, 2016/12/14
- Re: FYI: dfa: add an assertion to avoid coverity false positive, Paul Eggert, 2016/12/14
- Re: checked integer arithmetic, Bruno Haible, 2016/12/14
- Re: checked integer arithmetic, Eric Blake, 2016/12/14
- Re: checked integer arithmetic, Paul Eggert, 2016/12/14
- xalloc-oversized PTRDIFF_MAX fix (was: checked integer arithmetic), Paul Eggert, 2016/12/14
- Re: checked integer arithmetic, Bruno Haible, 2016/12/14
- Re: checked integer arithmetic, Bruno Haible, 2016/12/15
- Re: checked integer arithmetic, Paul Eggert, 2016/12/15
- Re: checked integer arithmetic, Bruno Haible, 2016/12/15
- Re: checked integer arithmetic,
Bruno Haible <=
- Re: checked integer arithmetic, Paul Eggert, 2016/12/16
Re: FYI: dfa: add an assertion to avoid coverity false positive, Paul Eggert, 2016/12/14