Question

Is there any option to omit variable type or to set variable type to int in c++ code that to be compiled with g++ compiler in linux.

    const bufLen = 2000;

Compilation went fine in solaris (as I am doing porting from solaris to linux).

One more thing ,I dont have control over the file as it is generated by some parser (provided by some third party in the form of binary)

Since I cant change the c++ file(as it is generated everytime before compilation) , I need some option (of g++) so I can include during compilation to suppress/resolve the error:

error: ISO C++ forbids declaration of `bufLen` with no type

EDIT :

INFO : options currently I am using -c -fPIC -Wno-deprecated -m32 -O2 -ffriend-injection -g

Is anyone of the options causing me trouble (or affecting other) ?


Thanks in advance

Was it helpful?

Solution

Thanks to AndersK who gave me a solution (through comments [below my question])

I tried compiling using -fms-extensions with g++ which resolved my problem

Reference : http://gcc.gnu.org/onlinedocs/gcc-3.4.4/gcc/C-Dialect-Options.html

PS : For visibility sake , I added the answer in answer section . Credits go to person who actually answered :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top