diff mbox series

[2/4] typeof: fix up comment in examine_pointer_type()

Message ID 20191109133519.63010-3-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series clarify evaluation of SYM_TYPEOF | expand

Commit Message

Luc Van Oostenryck Nov. 9, 2019, 1:35 p.m. UTC
The comment was added in commit c72032ad3 ("Add comment on what ...")
and explain why the size is set before recursing into the object
pointed to. But since commit 017034ed4 ("Fix up type examination.")
the object is nore examined.

Adjust the comment to remove posible confusion.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 symbol.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Ramsay Jones Nov. 10, 2019, 1:30 a.m. UTC | #1
On 09/11/2019 13:35, Luc Van Oostenryck wrote:
> The comment was added in commit c72032ad3 ("Add comment on what ...")
> and explain why the size is set before recursing into the object
> pointed to. But since commit 017034ed4 ("Fix up type examination.")
> the object is nore examined.

s/nore/now/?

ATB,
Ramsay Jones

> 
> Adjust the comment to remove posible confusion.
> 
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> ---
>  symbol.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/symbol.c b/symbol.c
> index 72ea2e4e7..334f9df29 100644
> --- a/symbol.c
> +++ b/symbol.c
> @@ -436,10 +436,11 @@ static struct symbol *examine_enum_type(struct symbol *sym)
>  static struct symbol *examine_pointer_type(struct symbol *sym)
>  {
>  	/*
> -	 * We need to set the pointer size first, and
> -	 * examine the thing we point to only afterwards.
> -	 * That's because this pointer type may end up
> -	 * being needed for the base type size evaluation.
> +	 * Since pointers to incomplete types can be used,
> +	 * for example in a struct-declaration-list,
> +	 * the base type must *not* be examined here.
> +	 * It thus means that it needs to be done later,
> +	 * when the base type of the pointer is looked at.
>  	 */
>  	if (!sym->bit_size)
>  		sym->bit_size = bits_in_pointer;
>
Luc Van Oostenryck Nov. 10, 2019, 8:37 a.m. UTC | #2
On Sun, Nov 10, 2019 at 01:30:31AM +0000, Ramsay Jones wrote:
> 
> 
> On 09/11/2019 13:35, Luc Van Oostenryck wrote:
> > The comment was added in commit c72032ad3 ("Add comment on what ...")
> > and explain why the size is set before recursing into the object
> > pointed to. But since commit 017034ed4 ("Fix up type examination.")
> > the object is nore examined.
> 
> s/nore/now/?

Arggg, I meant 'no more'.

Thanks,
-- Luc
diff mbox series

Patch

diff --git a/symbol.c b/symbol.c
index 72ea2e4e7..334f9df29 100644
--- a/symbol.c
+++ b/symbol.c
@@ -436,10 +436,11 @@  static struct symbol *examine_enum_type(struct symbol *sym)
 static struct symbol *examine_pointer_type(struct symbol *sym)
 {
 	/*
-	 * We need to set the pointer size first, and
-	 * examine the thing we point to only afterwards.
-	 * That's because this pointer type may end up
-	 * being needed for the base type size evaluation.
+	 * Since pointers to incomplete types can be used,
+	 * for example in a struct-declaration-list,
+	 * the base type must *not* be examined here.
+	 * It thus means that it needs to be done later,
+	 * when the base type of the pointer is looked at.
 	 */
 	if (!sym->bit_size)
 		sym->bit_size = bits_in_pointer;