linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* modifier_string() inconsistency with modifiers
@ 2010-08-20 10:33 Bernd Petrovitsch
  2010-08-20 23:03 ` Christopher Li
  0 siblings, 1 reply; 8+ messages in thread
From: Bernd Petrovitsch @ 2010-08-20 10:33 UTC (permalink / raw)
  To: linux-sparse

Hi all!

To dump/print the modifiers, I just found the
modifier_string() function (in show-parse.c).

To the best of my understanding
----  snip  ----
	const char *res,**ptr, *names[] = {
		"auto", "register", "static", "extern",
		"const", "volatile", "[signed]", "[unsigned]",
		"[char]", "[short]", "[long]", "[long long]",
		"[typdef]", "[structof]", "[unionof]", "[enum]",
		"[typeof]", "[attribute]", "inline", "[addressable]",
		"[nocast]", "[noderef]", "[accessed]", "[toplevel]",
		"[label]", "[assigned]", "[type]", "[safe]",
		"[usertype]", "[force]", "[explicitly-signed]",
		NULL
	};
----  snip  ----
lists printable strings for the modifiers. The modifiers are bits
defined in symbol.h.
----  snip  ----
/* Modifiers */
#define MOD_AUTO	0x0001
#define MOD_REGISTER	0x0002
#define MOD_STATIC	0x0004
#define MOD_EXTERN	0x0008

#define MOD_CONST	0x0010
#define MOD_VOLATILE	0x0020
#define MOD_SIGNED	0x0040
#define MOD_UNSIGNED	0x0080

#define MOD_CHAR	0x0100
#define MOD_SHORT	0x0200
#define MOD_LONG	0x0400
#define MOD_LONGLONG	0x0800

#define MOD_TYPEDEF	0x1000
#define MOD_WEAK	0x2000

#define MOD_INLINE	0x40000
#define MOD_ADDRESSABLE	0x80000

#define MOD_NOCAST	0x100000
#define MOD_NODEREF	0x200000
#define MOD_ACCESSED	0x400000
#define MOD_TOPLEVEL	0x800000	// scoping..

#define MOD_LABEL	0x1000000
#define MOD_ASSIGNED	0x2000000
#define MOD_TYPE	0x4000000
#define MOD_SAFE	0x8000000	// non-null/non-trapping pointer

#define MOD_USERTYPE	0x10000000
#define MOD_FORCE	0x20000000
#define MOD_EXPLICITLY_SIGNED	0x40000000
#define MOD_BITWISE	0x80000000
----  snip  ----
Well, the equivalent for "MOD_WEAK" is "[structof]" - which seems wrong
to me.
And the parts for "inline" also doesn't fit AFAICS.

What did I actually miss?

	Bernd
-- 
mobile: +43 664 4416156              http://www.sysprog.at/
    Linux Software Development, Consulting and Services


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

end of thread, other threads:[~2010-09-15 22:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-20 10:33 modifier_string() inconsistency with modifiers Bernd Petrovitsch
2010-08-20 23:03 ` Christopher Li
2010-08-22  8:42   ` Bernd Petrovitsch
2010-08-22 17:25     ` Christopher Li
2010-08-23 14:42       ` [PATCH] Fixup and cleanup of the modifier_string() function (was Re: modifier_string() inconsistency with modifiers) Bernd Petrovitsch
2010-09-03  9:13         ` Christopher Li
2010-09-14 14:37           ` [PATCH] Fixup and cleanup of the modifier_string() function Bernd Petrovitsch
2010-09-15 22:52             ` Christopher Li

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