savoy@iro.umontreal.ca (Jacques Savoy) (09/16/89)
I have found the following problem with the preprocessor :
if you misspell a token (privte indeed of private), you have
the following message :
"Errors detected in input file (your bison.simple is out of date) "
This message can't help me because i don't WHERE the preprocessor
found the misspelled word. (Think if you have many headers or
included files, the problem is very painful).
Here is an example :
---------------------------------------------------------------------
// File test.cc
#include <stream.h>
class X {
privte: // spelling error private must used indeed !
int val;
public:
X(int i) { val = i; }
X(char* pt) { val = strlen(pt); }
int value() { return val; }
};
main(int argc, char* argv[])
{
cout << "Enf of job \n";
exit(0);
}
// EOF test.cc
--------------------------------------------------------------------------
Compiling the file with :
$ g++ test.cc -o test -v
g++ version 1.35.0
/usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ test.cc /tmp/cca23831.cpp
GNU CPP version 1.35
/usr/local/lib/gcc-cc1plus /tmp/cca23831.cpp -quiet -dumpbase test.cc -noreg -version -o /tmp/cca23831.s
GNU C++ version 1.35.0 (sparc) compiled by GNU C version 1.35.
Errors detected in input file (your bison.simple is out of date) as /tmp/cca23831.s -o test.o
/usr/local/lib/gcc-ld++ -o test -C /usr/local/lib/crt0+.o test.o -lg++ /usr/local/lib/gcc-gnulib -lc
crt0.c:731: Undefined symbol _main referenced from text
-------------------------------------------------------------------------------
J.SAVOY