[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: restrict
From: |
Bruno Haible |
Subject: |
Re: restrict |
Date: |
Mon, 17 Feb 2020 04:53:14 +0100 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-171-generic; KDE/5.18.0; x86_64; ; ) |
Paul Eggert wrote:
> if GCC generated warnings for that sort of thing, the warnings would be false
> alarms.
Yes, and this in turn means that the ability to produce useful warnings via
'restrict' is limited. In this example:
===================================================================
#include <string.h>
extern void memmcpy (void *restrict, const void *restrict, size_t);
void shuffle (char array[10])
{
memmcpy (array + 2, array, 8);
memcpy (array + 2, array, 8);
}
===================================================================
gcc gives no warning about 'memmcpy' - because it does not know
how many elements the function will access. gcc does give a warning
about 'memcpy' - apparently due to custom logic in the compiler.
Bruno
- Possible testing case of snprintf., Mats Erik Andersson, 2020/02/09
- Re: Possible testing case of snprintf., Tim Rühsen, 2020/02/09
- Re: restrict, Bruno Haible, 2020/02/09
- Re: restrict, Jeffrey Walton, 2020/02/10
- Re: restrict, Tim Rühsen, 2020/02/10
- Re: restrict, Paul Eggert, 2020/02/16
- Re: restrict, Bruno Haible, 2020/02/16
- Re: restrict, Bruno Haible, 2020/02/16
- Re: restrict, Paul Eggert, 2020/02/16
- Re: restrict,
Bruno Haible <=
- Re: restrict, Tim Rühsen, 2020/02/17
- Re: restrict, Bruno Haible, 2020/02/17
- Re: restrict, Paul Eggert, 2020/02/17
- Re: restrict, Bruno Haible, 2020/02/17
- Re: restrict, Paul Eggert, 2020/02/17
- Re: restrict - summary, Bruno Haible, 2020/02/17
- Re: restrict - summary, Bruno Haible, 2020/02/22
- Re: restrict - summary, Eric Blake, 2020/02/24
- Re: restrict - summary, Bruno Haible, 2020/02/23
- Re: restrict - summary, Bruno Haible, 2020/02/23