public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* misleading description in vec.h?
@ 2011-09-26 16:23 Liang Wang
  2011-09-26 17:35 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: Liang Wang @ 2011-09-26 16:23 UTC (permalink / raw)
  To: gcc

Hi,

Here is comment from line 36, gcc/vec.h

Both the structure object and pointer variants
pass pointers to objects around -- in the former case the pointers
are stored into the vector and in the latter case the pointers are
dereferenced and the objects copied into the vector.

But by reading implementation, it seems that this description is reverse.
I think that it should be something like

in the *latter* case the pointers
are stored into the vector and in the *former* case the pointers are
dereferenced and the objects copied into the vector.

That is, the pointers in structure object variant are dereferenced and
the objects copied into the vector.

Am I missing something?

Thanks,
Liang.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: misleading description in vec.h?
  2011-09-26 16:23 misleading description in vec.h? Liang Wang
@ 2011-09-26 17:35 ` Ian Lance Taylor
  2011-09-27  9:51   ` Liang Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Lance Taylor @ 2011-09-26 17:35 UTC (permalink / raw)
  To: Liang Wang; +Cc: gcc

Liang Wang <netcasper@gmail.com> writes:

> Here is comment from line 36, gcc/vec.h
>
> Both the structure object and pointer variants
> pass pointers to objects around -- in the former case the pointers
> are stored into the vector and in the latter case the pointers are
> dereferenced and the objects copied into the vector.
>
> But by reading implementation, it seems that this description is reverse.
> I think that it should be something like
>
> in the *latter* case the pointers
> are stored into the vector and in the *former* case the pointers are
> dereferenced and the objects copied into the vector.
>
> That is, the pointers in structure object variant are dereferenced and
> the objects copied into the vector.

I think you are correct and the comment is wrong.

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: misleading description in vec.h?
  2011-09-26 17:35 ` Ian Lance Taylor
@ 2011-09-27  9:51   ` Liang Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Liang Wang @ 2011-09-27  9:51 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc

On Tue, Sep 27, 2011 at 12:27 AM, Ian Lance Taylor <iant@google.com> wrote:
> Liang Wang <netcasper@gmail.com> writes:
>
>> Here is comment from line 36, gcc/vec.h
>>
>> Both the structure object and pointer variants
>> pass pointers to objects around -- in the former case the pointers
>> are stored into the vector and in the latter case the pointers are
>> dereferenced and the objects copied into the vector.
>>
>> But by reading implementation, it seems that this description is reverse.
>> I think that it should be something like
>>
>> in the *latter* case the pointers
>> are stored into the vector and in the *former* case the pointers are
>> dereferenced and the objects copied into the vector.
>>
>> That is, the pointers in structure object variant are dereferenced and
>> the objects copied into the vector.
>
> I think you are correct and the comment is wrong.

Thanks.  Patch is sent to gcc-patches.

Liang

>
> Ian
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-09-27  1:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-26 16:23 misleading description in vec.h? Liang Wang
2011-09-26 17:35 ` Ian Lance Taylor
2011-09-27  9:51   ` Liang Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).