﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	field_blocks	field_dependson	field_seealso
530	Type check link argument of list_get_instance macro	Jiri Svoboda		"It bit me several times that list_get_instance() measures the offset of the link argument, but does not access it. The problem is that you can (mistakenly pass) any other field of the same structure and your code will compile (but crash).

Typical example is when you have a collection_t containing a list of foo_t where foo_t has the fields:
 * collection_t coll;
 * link_t lcoll;
it's all too easy to write list_get_instance(link, foo_t, coll) instead of list_get_instance(link, foo_t, lcoll).

I suggest we could improve the macro to check the type of the third argument in some way. Possible ways include:
  * access .prev or .next from the link and drop the result
  * pass address of link to a dummy type-checking function (e.g. a static inline function if you want to make sure it gets optimized away)
"	enhancement	closed	minor	0.6.0	helenos/unspecified	mainline	fixed					
