linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/5] Fix an __attribute__() parsing error
@ 2007-05-22 18:11 Ramsay Jones
  2007-05-22 22:37 ` Josh Triplett
  0 siblings, 1 reply; 5+ messages in thread
From: Ramsay Jones @ 2007-05-22 18:11 UTC (permalink / raw)
  To: Josh Triplett; +Cc: Sparse Mailing-list

[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]



Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---

When updating this patch from the 0.3 version, I made the (new) third parameter
KW_ATTRIBUTE only, rather than (KW_ATTRIBUTE | KW_ASM), since it did not seem
correct to allow an asm there; is that correct?

The test case for this was abstracted from an example in the "expat.h" header file.

$cat ape.c

typedef void (__attribute__((__cdecl__)) *FP)(void *u, const char *n);

void set_FP(void *cb, FP f);

$

  parse.c |    5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/parse.c b/parse.c
index db5c9e6..16a6dce 100644
--- a/parse.c
+++ b/parse.c
@@ -1149,7 +1149,10 @@ static struct token *direct_declarator(struct token *token, struct symbol *decl,
  		if (token->special == '(') {
  			struct symbol *sym;
  			struct token *next = token->next;
-			int fn = (p && *p) || match_op(next, ')') || lookup_type(next);
+			int fn;
+
+			next = handle_attributes(next, ctype, KW_ATTRIBUTE);
+			fn = (p && *p) || match_op(next, ')') || lookup_type(next);

  			if (!fn) {
  				struct symbol *base_type = ctype->base_type;
-- 
1.5.1


[-- Attachment #2: ape.c --]
[-- Type: text/plain, Size: 103 bytes --]


typedef void (__attribute__((__cdecl__)) *FP)(void *u, const char *n);

void set_FP(void *cb, FP f);


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

* Re: [PATCH 4/5] Fix an __attribute__() parsing error
  2007-05-22 18:11 [PATCH 4/5] Fix an __attribute__() parsing error Ramsay Jones
@ 2007-05-22 22:37 ` Josh Triplett
  2007-05-22 23:17   ` Michael Stefaniuc
  2007-05-24 15:27   ` Ramsay Jones
  0 siblings, 2 replies; 5+ messages in thread
From: Josh Triplett @ 2007-05-22 22:37 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: Sparse Mailing-list, Michael Stefaniuc

[-- Attachment #1: Type: text/plain, Size: 730 bytes --]

Ramsay Jones wrote:
> 
> When updating this patch from the 0.3 version, I made the (new) third parameter
> KW_ATTRIBUTE only, rather than (KW_ATTRIBUTE | KW_ASM), since it did not seem
> correct to allow an asm there; is that correct?

Correct; I don't think you can have an asm there.

> The test case for this was abstracted from an example in the "expat.h" header file.
> 
> $cat ape.c
> 
> typedef void (__attribute__((__cdecl__)) *FP)(void *u, const char *n);
> 
> void set_FP(void *cb, FP f);

Applied.  I think you just made a Wine developer very happy.  Michael, this
patch fixes the test case you provided for Wine; I applied your patch for the
new test case.

Thanks, Ramsay!

- Josh Triplett



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

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

* Re: [PATCH 4/5] Fix an __attribute__() parsing error
  2007-05-22 22:37 ` Josh Triplett
@ 2007-05-22 23:17   ` Michael Stefaniuc
  2007-05-24 17:07     ` Ramsay Jones
  2007-05-24 15:27   ` Ramsay Jones
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Stefaniuc @ 2007-05-22 23:17 UTC (permalink / raw)
  To: Josh Triplett; +Cc: Ramsay Jones, Sparse Mailing-list

Josh Triplett wrote:
> Ramsay Jones wrote:
>> When updating this patch from the 0.3 version, I made the (new) third parameter
>> KW_ATTRIBUTE only, rather than (KW_ATTRIBUTE | KW_ASM), since it did not seem
>> correct to allow an asm there; is that correct?
> 
> Correct; I don't think you can have an asm there.
> 
>> The test case for this was abstracted from an example in the "expat.h" header file.
>>
>> $cat ape.c
>>
>> typedef void (__attribute__((__cdecl__)) *FP)(void *u, const char *n);
>>
>> void set_FP(void *cb, FP f);
> 
> Applied.  I think you just made a Wine developer very happy.  Michael, this
> patch fixes the test case you provided for Wine; I applied your patch for the
> new test case.
Cool, thanks. Was just running a Wine build with cgcc when I have seen
this so i've stopped it and run it again with the latest git checkout.
And indeed it looks definitely better; the "error: too many errors"
count went down from 1459 to 7.

> Thanks, Ramsay!
Thanks indeed.

bye
	michael
-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
Sr. Network Engineer            Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani@redhat.com
Hauptstaetterstr. 58            http://www.redhat.de/
D-70178 Stuttgart

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

* Re: [PATCH 4/5] Fix an __attribute__() parsing error
  2007-05-22 22:37 ` Josh Triplett
  2007-05-22 23:17   ` Michael Stefaniuc
@ 2007-05-24 15:27   ` Ramsay Jones
  1 sibling, 0 replies; 5+ messages in thread
From: Ramsay Jones @ 2007-05-24 15:27 UTC (permalink / raw)
  To: Josh Triplett; +Cc: Sparse Mailing-list, Michael Stefaniuc

Josh Triplett wrote:
> Ramsay Jones wrote:
>> When updating this patch from the 0.3 version, I made the (new) third parameter
>> KW_ATTRIBUTE only, rather than (KW_ATTRIBUTE | KW_ASM), since it did not seem
>> correct to allow an asm there; is that correct?
> 
> Correct; I don't think you can have an asm there.
> 
OK, good.

>> The test case for this was abstracted from an example in the "expat.h" header file.
>>
>> $cat ape.c
>>
>> typedef void (__attribute__((__cdecl__)) *FP)(void *u, const char *n);
>>
>> void set_FP(void *cb, FP f);
> 
> Applied.  I think you just made a Wine developer very happy.  Michael, this
> patch fixes the test case you provided for Wine; I applied your patch for the
> new test case.
> 
> Thanks, Ramsay!
> 

My pleasure.

ATB,
Ramsay Jones

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

* Re: [PATCH 4/5] Fix an __attribute__() parsing error
  2007-05-22 23:17   ` Michael Stefaniuc
@ 2007-05-24 17:07     ` Ramsay Jones
  0 siblings, 0 replies; 5+ messages in thread
From: Ramsay Jones @ 2007-05-24 17:07 UTC (permalink / raw)
  To: Michael Stefaniuc; +Cc: Josh Triplett, Sparse Mailing-list

Michael Stefaniuc wrote:
> Josh Triplett wrote:
>> Ramsay Jones wrote:

>> Applied.  I think you just made a Wine developer very happy.  Michael, this
>> patch fixes the test case you provided for Wine; I applied your patch for the
>> new test case.
> Cool, thanks. Was just running a Wine build with cgcc when I have seen
> this so i've stopped it and run it again with the latest git checkout.
> And indeed it looks definitely better; the "error: too many errors"
> count went down from 1459 to 7.
> 
>> Thanks, Ramsay!
> Thanks indeed.

My pleasure; glad to be of help.

All the Best,

Ramsay Jones

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

end of thread, other threads:[~2007-05-24 17:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-22 18:11 [PATCH 4/5] Fix an __attribute__() parsing error Ramsay Jones
2007-05-22 22:37 ` Josh Triplett
2007-05-22 23:17   ` Michael Stefaniuc
2007-05-24 17:07     ` Ramsay Jones
2007-05-24 15:27   ` Ramsay Jones

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