deb@allegra.UUCP (02/24/87)
/* file -- bug.c */
struct foo {
void doit();
void start();
int next() { return 13; }
int cond() { return 37;}
};
void foo::start() {}
void foo::doit()
{
for(start(); cond(); next())
;
}
=======================================
$ CC -c bug.c
CC +L bug.c:
"bug.c", line 15: sorry, not implemented: call of inline void function in for expression
1 error
$
=======================================
Problem: start() is NOT inline. Poor user (ME!!) went nuts looking
for the inline function C++ was complaining about!
Note: as long as start() is void (inline or no) this error message
results. If start() wasn't void, as next() is not, then
there is no problem, inline or not.
Summary: Quick fix -- make those void functions return an int a la next()
above. Annoying since it messes up the sense of the program since
this function returns a value that is ignored.
------------------
Has anyone found this one? In switch statements, constructs
which require con/de-structors must be in a block. If they
are not, you get warned, right?
Not always -- I had a sufficiently complicated case that C++
did NOT warn me! As a result the C code destructed something that
was never constructed -- bad news. Unfortunately, I have not saved
the code.
David Baraff
AT&T Bell Laboratories