I recently ran across this in the Linux Kernel sources and was also mystified. Tracking down an answer was not the simplest and I'm providing an answer to this question with the hope that, in the future, someone will see the answer for what it is and not miss the answer in the comments.
As @MarcGlisse correctly stated, you cannot find noderef or _address_space_ in the GCC docs because they are not GCC attributes. They have meaning only for Sparse. This why things like __iomem
are defined thusly
#ifdef __CHECKER__
#define __iomem __attribute__((noderef, address_space(2)))
#else
#define __iomem
#endif
Under "normal" compilation, the macro is defined but effectively ignored. If the checker, i.e. Sparse, is enabled, it is meticulously scrutinized.
@alk commented some time ago by providing a link to this LKML article in which Linus explains things quite well. I first ran across this article linked in this Linux Questions thread asked in 2006. Strangely, my browser refused to open the link for "security reasons" and I had to find it the hard way in the LKML archives.
I hope this helps in understanding what is happening. Since you've asked this question ~2.5 years ago, you've likely found this to be the case.
EDIT
The answer was down-voted. Thinking that it may be because I neglected to offer a meaning for noderef
, I'm going to offer one now. As I mentioned in the answer, it is a signal to sparse to check for something: the dereference of a pointer. Consider this simple program:
#include <stdio.h>
#ifdef __CHECKER__
#define __void_region __attribute__((noderef, address_space(2)))
#else
#define __void_region
#endif
int main(void)
{
int i;
void * __void_region pMemory = NULL;
pMemory = &i;
printf("i is: %d\n", *(int*)pMemory);
return 0;
}
When using sparse to check this, I get the following:
$ sparse foo.c
foo.c:14:9: warning: dereference of noderef expression
foo.c:16:37: warning: dereference of noderef expression
Basically, the definition informs sparse to signal occurances of a dereference of pMemory
. This is a meaningless program but in the kernel, __iomem
should never be dereferenced but accessed only through the appropriate I/O Kernel API.