[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Module with preprocessor utilities
From: |
Marc Nieper-Wißkirchen |
Subject: |
Re: Module with preprocessor utilities |
Date: |
Fri, 24 Jul 2020 10:33:08 +0200 |
Am Fr., 24. Juli 2020 um 10:05 Uhr schrieb Florian Weimer <fweimer@redhat.com>:
> It's still a candidate for an RFE. Martin Sebor has been working on
> such warnings. I'm going to talk to him.
It may also be useful for optimizations because the compiler may make
assumptions.
> >> It's also undefined when you pass the address of something that is not
> >> the first element of an array of type double to foo1. (Undefined in the
> >> sense that the standard does not say what happens in that case.)
> >
> > Yes, but a pointer to (an existing) double fulfills this requirement.
>
> I don't think that's how the standard defines “first element of an
> array”. I suspect the intent was that it the pointer has to point to an
> array of at least the indicated number of elements, but that's not what
> the standard says.
According to ISO C, "an array type describes a contiguously allocated
nonempty set of objects with a particular member object type, called
the element type". Thus, given
double x;
double *p = &x;
the pointer p points to the first element of an array (of length 1).
Maybe I have misunderstood you.
Thanks,
Marc
- Re: Module with preprocessor utilities, (continued)
Re: Module with preprocessor utilities, Paul Eggert, 2020/07/20
- Re: Module with preprocessor utilities, Marc Nieper-Wißkirchen, 2020/07/20
- Re: Module with preprocessor utilities, Bruno Haible, 2020/07/20
- Message not available
- Re: Module with preprocessor utilities, Bruno Haible, 2020/07/23
- Re: Module with preprocessor utilities, Florian Weimer, 2020/07/24
- Re: Module with preprocessor utilities, Marc Nieper-Wißkirchen, 2020/07/24
- Re: Module with preprocessor utilities, Florian Weimer, 2020/07/24
- Re: Module with preprocessor utilities,
Marc Nieper-Wißkirchen <=
- Re: Module with preprocessor utilities, Florian Weimer, 2020/07/24
- Re: Module with preprocessor utilities, Marc Nieper-Wißkirchen, 2020/07/24