remove "in function XXX" messages

The later warning has an exact source position of the variable anyway,
having a prior "note: in function" is  just seen as an additional error
location in editors although there is no actual error at the beginning
of the function.