TUNABLE_INT question

John Baldwin jhb at freebsd.org
Tue Feb 17 14:23:23 PST 2009


On Friday 13 February 2009 5:16:07 pm Roman Divacky wrote:
> On Fri, Feb 13, 2009 at 03:55:44PM -0500, Ryan Stone wrote:
> > __FILE__ is a string so you can't concat that with anything to produce an
> > identifier.  In any case, the variable is static so there can't be any
> > collision problems with other files.
> 
> I was talking about the SYSINIT parameter. thats a section in a .o
> file, and I am getting collisions there...

Hmm, are you doing something like this:

#define FOO(string) \
	TUNABLE_INT(string ## ".bar", &bar); \
	TUNABLE_INT(string ## ".foo", &foo); \

FOO(baz)

That would collide as both of the TUNABLE_INT() invocations would have the 
same __LINE__ (the line number of the 'FOO(baz)').

-- 
John Baldwin


More information about the freebsd-hackers mailing list