bug-gnulib
[Top][All Lists]
Advanced

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

Re: Module with preprocessor utilities


From: Florian Weimer
Subject: Re: Module with preprocessor utilities
Date: Fri, 24 Jul 2020 10:05:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

* Marc Nieper-Wißkirchen:

> 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.

It's still a candidate for an RFE.  Martin Sebor has been working on
such warnings.  I'm going to talk to him.

>> 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.

Thanks,
Florian




reply via email to

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