Implied int types

Rod Roark rod at sunsetsystems.com
Sat Oct 7 18:12:58 PDT 2000


On Sat, 07 Oct 2000, Sergey Ostrovsky wrote:
> Rod Roark wrote:
> 
> > Yeah, it didn't work.   -- Rod
> >
> > On Sat, 07 Oct 2000, Sergey Ostrovsky wrote:
> > > Rod Roark wrote:
> > >
> > > > In compiling various add-on packages for my LFS system, I have run
> > > > across several source files where gcc errors out on this type of
> > > > statement:
> > > >
> > > >   static <variable-name> = <integer-literal>;
> > > >
> > > > where the proper form is:
> > > >
> > > >   static int <variable-name> = <integer-literal>;
> > > >
> > > > Evidently the first form is accepted by some compilers.  Does anyone
> > > > know of a compiler option that will get gcc-2.95.2 to accept it also?
> > > > I'm getting tired of patching all this source code.
> > > >
> > > > Thanks.
> > > >
> > > > -- Rod
> > > >    http://www.sunsetsystems.com/
> > >
> > > Hi Rod,
> > > the only gcc option to process pre-ANSI crap is -traditional ...
> > > Have you tried ?
> > >
> > > Sergey Ostrovsky
> 
> And without -ansi ?

[rod at rod rod]$ cat > test.cpp
void test() {static i = 0;}
^D
[rod at rod rod]$ g++ -c -traditional test.cpp
test.cpp: In function `void test()':
test.cpp:1: ANSI C++ forbids declaration `i' with no type
[rod at rod rod]$                                                                                               

-- Rod
   http://www.sunsetsystems.com/

-- 
Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message




More information about the lfs-dev mailing list