From: "Chris Li" <christ.li@gmail.com>
To: Mitesh Shah <mshah@teja.com>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: attributes are not stored at right location for array variables
Date: Wed, 31 Jan 2007 11:53:51 -0800 [thread overview]
Message-ID: <70318cbf0701311153k126d4aeam5f68f1c519d3a7af@mail.gmail.com> (raw)
In-Reply-To: <AKEOJDDJLNPHDAKOMMBHGEPKCPAA.mshah@teja.com>
Your patch assumes every attribute apply to node instead of type.
Is there any attribute need to apply to type instead?
For your change, apply_modifiers() need to change where it take the
__mode__ attribute as well.
Chris
On 1/31/07, Mitesh Shah <mshah@teja.com> wrote:
>
> It seems that the attributes are not stored with the variable ctype when the variable is an array. For declaration such as,
>
> char c[100] __attribute__((aligned(64)));
>
> The attribute is stored with the array ctype instead of the variable C ctype.
>
> In function direct_declarator in parse.c at line 920 the ctype gets replaced with the array ctype and in the next iteration it is
> passed to handle_attributes. handle_attributes should be passed the original ctype so here is the patch.
>
> Thanks,
>
> -Mitesh
>
> -------------------------------------------------------
>
> index 5077ee6..306b144 100644
> --- a/parse.c
> +++ b/parse.c
> @@ -881,7 +881,7 @@ static struct token *direct_declarator(struct token *token, struct symbol *decl,
> }
>
> for (;;) {
> - token = handle_attributes(token, ctype);
> + token = handle_attributes(token, &decl->ctype);
>
> if (token_type(token) != TOKEN_SPECIAL)
> return token;
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2007-01-31 19:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-31 16:57 attributes are not stored at right location for array variables Mitesh Shah
2007-01-31 19:53 ` Chris Li [this message]
2007-01-31 22:33 ` Mitesh Shah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=70318cbf0701311153k126d4aeam5f68f1c519d3a7af@mail.gmail.com \
--to=christ.li@gmail.com \
--cc=linux-sparse@vger.kernel.org \
--cc=mshah@teja.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).