<snip>
>> I dont understand what goal is it supposed to achieve
>> at the beginning of the headerfile
<snip>

The 'goal' is to prevent 'redefinition' errors, like Stephan Müller said it
is a 'include guard'.

A explanation of why and how to use include guards can be found here:
https://en.wikipedia.org/wiki/Include_guard

When I try : find . -name "*.c" -o -name "*.h" | xargs grep -i "include
<linux/list.h>" | wc -l

It gives me 1319 instances where list.h is being included, imagine your
function being redefined that many times. Not only will gcc bitch and
complain about redefinition errors but go screaming into the night like
Valdis says.. [grin]

If you still have difficulty understanding why, the best way would be to
write some simple code yourself then compile, you will start to see why we
require the #ifndef.

Thanks - Aruna
_______________________________________________
Kernelnewbies mailing list
[email protected]
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to