[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 09:47:59 +0200 |
Am Fr., 24. Juli 2020 um 08:53 Uhr schrieb Florian Weimer <fweimer@redhat.com>:
> * Bruno Haible:
> > (This is with gcc 10.1.0.)
> >
> > clang, OTOH, produces warnings for both foo1 and foo2.
> >
> > But I won't spend time to report a GCC bug on this, because - as you said -
> > without the ability to declare a pointer to an incomplete type or a 'void *'
> > as non-null, this language feature is worthless.
I don't think that it is a bug in the technical sense. A C99 compiler
does not have to warn as, in general, it is undecidable whether a
particular argument is NULL or not.
For reference, this language feature is described in 6.7.5.3 (7) in
the ISO C99 document.
It's good for documenting interfaces as is the restrict qualifier, or,
rather, it would be good if ISO C allowed arrays of incomplete types
where pointers of incomplete types are allowed.
So, instead of filing a bug for GCC, it may a better use of one's time
to file a request with WG 14 to relax the language in this regard.
> 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.
Marc
- Module with preprocessor utilities, Marc Nieper-Wißkirchen, 2020/07/19
- 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 <=
- 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, 2020/07/24