Greetings,
I am trying to compile some code on Solaris. I need to compile that
using CC instead of g++.
Following small program is representation of my problem
/home/ajain/warningRemoval>cat varsizearray.cpp
int main()
{
int len = 2*3 ;
int a[len];
a[1]=34;
}
----------------------
/home/ajain/warningRemoval>g++ varsizearray.cpp
/home/ajain/warningRemoval>CC varsizearray.cpp
"varsizearray.cpp", line 4: Error: An integer constant expression is
required within the array subscript operator.
1 Error(s) detected.
/home/ajain/warningRemoval>which CC
/opt/SUNWspro/bin/CC
/home/ajain/warningRemoval>
My doubt is whether some flag exists for CC which can help me remove
this error. I have such declarations at many places in my code so I do
not want to change code for this.
Thanks in advance,
regards,
Amit Jain
am********@gmail.com