Tool/software: TI C/C++ Compiler
Hello,
Since I am compiling all my code as c++, I decided to remove all the extern "C" declarations from all the project header files.
After doing so, the compiler started giving me a quite a few errors about the redefined functions fgetc, fputc and sscanf.
#20 identifier "sscanf" is undefined .... C/C++ Problem
#110 expression preceding parentheses of apparent call must have (pointer-to-) function type .... C/C++ Problem
#161 declaration is incompatible with previous "std::fgetc" (declared at line 224 of "C:/ti/ccs6_2_0/ccsv6/tools/compiler/c2000_15.12.3.LTS/include/stdio.h") .... C/C++ Problem
#20 identifier "FILE" is undefined ... C/C++ Problem
#310 more than one instance of function "fputc" matches the argument list: ... C/C++ Problem
#760 "FILE" is not a type name ..... C/C++ Problem
I renamed the fgetc and fputc functions to match the prototypes in stido.h (shown below), but sscanf is still undefined.
int fgetc(register std::FILE *_fp);
int fputc(int _c, register std::FILE *_fp);
Is it really necessary to use the above function prototype?
It seems I am doing something wrong. I used cstdio instead of stdio.h, but the compiler is still including stdio.h.
Can someone point me in the right direction on how to redefine the above functions and at the same time still use C++.
Thanks,
Stephen