This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Erroneous program misbehaves without warning
- To: <gcc at egcs dot cygnus dot com>
- Subject: Erroneous program misbehaves without warning
- From: "Thomas Womack" <tom at womack dot net>
- Date: Mon, 15 Nov 1999 12:22:30 -0000
Consider the following program
vector<pair<int,int> > pfact(int n)
{
cout << n;
}
void main(void)
{
pfact(6);
pfact(7);
}
It compiles *without warnings* with gcc-2.95.2 (mingw32; Mumit Khan's port),
but goes into an infinite loop after printing the six.
OK, it's a stupid program - the function fails to return a value, and the
value is then ignored by the caller - but it should at least print warnings,
and ideally fail to compile; compiling to something which hangs is not the
right idea at all.
{this is my first post to gcc@gcc.cygnus.com, which I read via the Web
interface; have I done something wrong?}
Tom