Skip to contentSkip to conversation

Ignore the ms_abi/sysv_abi attributes.

PATCH Michael Stefaniuc 2 participants 4 messages Sep 29, 2009 – Sep 30, 2009 Sparse checker

lore
Share & tools
lore
#0 lore raw

This is needed for getting a meaningful sparse run on a Wine 64-bit compile. Else the basic Win32 headers will produce tons of
error: attribute 'ms_abi': unknown attribute
which end in
error: too many errors.

The sysv_abi attribute was just added for symmetry.

---
 parse.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
parse.c +4 -0
index 5e75242..5f6f9c3 100644
@@ -525,6 +525,10 @@ static struct init_keyword {
 	{ "__stdcall__",	NS_KEYWORD,	.op = &ignore_attr_op },
 	{ "fastcall",	NS_KEYWORD,	.op = &ignore_attr_op },
 	{ "__fastcall__",	NS_KEYWORD,	.op = &ignore_attr_op },
+	{ "ms_abi",	NS_KEYWORD,	.op = &ignore_attr_op },
+	{ "__ms_abi__",	NS_KEYWORD,	.op = &ignore_attr_op },
+	{ "sysv_abi",	NS_KEYWORD,	.op = &ignore_attr_op },
+	{ "__sysv_abi__",	NS_KEYWORD,	.op = &ignore_attr_op },
 	{ "dllimport",	NS_KEYWORD,	.op = &ignore_attr_op },
 	{ "__dllimport__",	NS_KEYWORD,	.op = &ignore_attr_op },
 	{ "dllexport",	NS_KEYWORD,	.op = &ignore_attr_op },
Signature · 1 line
1.6.5.rc1
maintainer
#1 lore raw
Quoted 7 lines · Michael Stefaniuc

This is needed for getting a meaningful sparse run on a Wine 64-bit compile. Else the basic Win32 headers will produce tons of
error: attribute 'ms_abi': unknown attribute
which end in
error: too many errors.

The sysv_abi attribute was just added for symmetry.

Thanks for the patch. Ignoring the attribute has become so common now. I decide stop the complicate way to adding ignored attributes.

I attach two patches to simplify things. I am I am going to push them out to chrisl tree.

Can you change your patch base on my new patch?

It should be really simple, just add one string for each attribute is good enough.

Thanks!

Chris

From b0baf9ed31ef756734331cf9b8a9ab377e93d316 Mon Sep 17 00:00:00 2001
From: Christopher Li <[email protected]>
Date: Tue, 29 Sep 2009 14:58:48 -0700
Subject: [PATCH] Move noreturn attribute out of ignore attr area

---
 parse.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
parse.c +2 -2
index 90403d8..b3bf15d 100644
@@ -454,6 +454,8 @@ static struct init_keyword {
 	{ "mode",	NS_KEYWORD,	.op = &mode_op },
 	{ "context",	NS_KEYWORD,	.op = &context_op },
 	{ "__transparent_union__",	NS_KEYWORD,	.op = &transparent_union_op },
+	{ "noreturn",	NS_KEYWORD,	MOD_NORETURN,	.op = &attr_mod_op },
+	{ "__noreturn__",	NS_KEYWORD,	MOD_NORETURN,	.op = &attr_mod_op },
 
 	{ "__mode__",	NS_KEYWORD,	.op = &mode_op },
 	{ "QI",		NS_KEYWORD,	MOD_CHAR,	.op = &mode_QI_op },
@@ -489,8 +491,6 @@ static struct init_keyword {
 	{ "const",	NS_KEYWORD,	.op = &ignore_attr_op },
 	{ "__const",	NS_KEYWORD,	.op = &ignore_attr_op },
 	{ "__const__",	NS_KEYWORD,	.op = &ignore_attr_op },
-	{ "noreturn",	NS_KEYWORD,	MOD_NORETURN,	.op = &attr_mod_op },
-	{ "__noreturn__",	NS_KEYWORD,	MOD_NORETURN,	.op = &attr_mod_op },
 	{ "no_instrument_function",	NS_KEYWORD,	.op = &ignore_attr_op },
 	{ "__no_instrument_function__",	NS_KEYWORD,	.op = &ignore_attr_op },
 	{ "sentinel",	NS_KEYWORD,	.op = &ignore_attr_op },
Signature · 1 line
1.6.0.6

From dc9f14bd8cca5023f3ea07f2f3969737d9448c6a Mon Sep 17 00:00:00 2001
From: Christopher Li <[email protected]>
Date: Tue, 29 Sep 2009 16:17:23 -0700
Subject: [PATCH] Declare ignored attributres into a list of string.

Adding ignored attributes is much easier now.

---
 lib.h   |    4 ++
 parse.c |  153 ++++++++++++++++++++++++++++++++++-----------------------------
 2 files changed, 86 insertions(+), 71 deletions(-)
lib.h +4 -0
index 25abb80..e19973f 100644
@@ -20,6 +20,10 @@
 #define DO_STRINGIFY(x) #x
 #define STRINGIFY(x) DO_STRINGIFY(x)
 
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
+#endif
+
 extern int verbose, optimize, optimize_size, preprocessing;
 extern int die_if_error;
 extern int repeat_phase, merge_phi_sources;
parse.c +82 -71

173 lines not on this page · raw message

Signature · 1 line
1.6.0.6
#2 lore raw
Quoted 9 lines · Christopher Li
Quoted 7 lines · Michael Stefaniuc

This is needed for getting a meaningful sparse run on a Wine 64-bit compile. Else the basic Win32 headers will produce tons of
error: attribute 'ms_abi': unknown attribute
which end in
error: too many errors.

The sysv_abi attribute was just added for symmetry.

Quoted 7 lines

Thanks for the patch. Ignoring the attribute has become so common now. I decide stop the complicate way to adding ignored attributes.

I attach two patches to simplify things. I am I am going to push them out to chrisl tree.

Can you change your patch base on my new patch?

Done!

Quoted 2 lines

It should be really simple, just add one string for each attribute is good enough.

The nicest part about this is that the ignored attributes are now sorted alphabetically and one doesn't have to figure out where exactly to add them.

thanks
bye
michael

maintainer
#3 lore raw
Quoted 2 lines · Michael Stefaniuc

The nicest part about this is that the ignored attributes are now sorted alphabetically and one doesn't have to figure out where exactly to add them.

Thanks, I like that too :-)

I actually write a five lines python script to short them and make sure I did not drop some of the attributes.

Chris