Subject: Re: Global variable name which equals to func name causes coredump(gcc).
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: John Nemeth <firstname.lastname@example.org>
Date: 09/28/2007 06:56:12
On Jan 12, 9:53pm, der Mouse wrote:
} >> Now I think it is a very terrible problem: I can't have any global
} >> varible whose name is the same with those in libraries. For
} >> example, __srefill, __sread called by fread, or thounds of any other
} >> function
} > You can't have any variable starting with _ in your programs -
} > they're for system use.
} I'm not sure what kind of "can't" this is. They certainly work for me.
} They're risky, true, because of this kind of thing, but that's hardly
} "can't have" them.
} It does mean that this problem definitely isn't a bug as applied to
} such variables, but that's a very different statement. (I'm not sure
Actually, it would be a bug, except it would be a bug in the
application. Variables beginning with "_" are reserved for the
implementation. Applications aren't allowed to use any variables
starting with "_". It's true that you can use them, but you do so at
your own risk (including being LARTed for standards violations). Even
K&R2 mentions that you shouldn't use them.
}-- End of excerpt from der Mouse