[cfe-dev] 'const void' is considered to be an incomplete type by clang 3.5.0

Richard Smith richard at metafoo.co.uk
Mon Apr 21 14:18:30 PDT 2014


On Mon, Apr 21, 2014 at 12:21 PM, Hal Finkel <hfinkel at anl.gov> wrote:

> ----- Original Message -----
> > From: "Yuri" <yuri at rawbw.com>
> > To: "Hal Finkel" <hfinkel at anl.gov>
> > Cc: cfe-dev at cs.uiuc.edu
> > Sent: Monday, April 21, 2014 2:16:16 PM
> > Subject: Re: [cfe-dev] 'const void' is considered to be an incomplete
> type by clang 3.5.0
> >
> > On 04/21/2014 12:07, Hal Finkel wrote:
> > > What do you mean? As I understand it, void is always incomplete.
> > > What do you expect sizeof(const void) to return?
> >
> > 'incomplete' implies that it can be completed, and 'const void' can't
> > be
> > completed.
>
> Perhaps, but 'incomplete' here is the correct technical term. 3.9.1 says,
> "The void type is an incomplete type that cannot be completed.".
>
> > So there are two different situations and this message
> > doesn't differentiate between them.
> > The message should say "can't apply 'sizeof' to 'const void'" to be
> > more
> > clear.
> >
> > Curiously, clang-3.3 thought that sizeof(const void) is 1.
>
> Interesting.
>

Hmm, maybe this was the GNU 'arithmetic on void pointers' extension leaking
through?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140421/2376491f/attachment.html>


More information about the cfe-dev mailing list