[BusyBox] gcc problem in editor/sed.c

Rob Landley rob at landley.net
Thu Oct 9 20:19:40 UTC 2003

On Thursday 09 October 2003 02:23, Glenn McGrath wrote:
> On Thu, 09 Oct 2003 09:02:44 +0200
> Steven Scholz <steven.scholz at imc-berlin.de> wrote:
> > Hi there,
> >
> > editor/sed.c does not compile using (a Cross Tool Chain based on) gcc
> > 2.95.4:
> Ive checked this into cvs, i didnt even know such declarations were
> allowed.

It's a c++ism that gcc allows to be used in normal C.  C allows you to declare 
at the start of blocks (put curly brackets around it), but not halfway 
through a block.

Possibly what's different about your cross tool chain is gcc is getting 
different arguments.  Are you feeding it the -ansi or -pedantic switches, 

I don't use c++isms on purpose in C code (this includes // comments, even 
through I prefer them to /* */ style), but it's possible I introduced it 
accidentally during my sed rewrite (perhaps while merging two functions, or 
removing a blocking level from simplified code).  Errors the compiler doesn't 
catch and which don't show up in testing are kind of hard to avoid... :)

> Glenn


More information about the busybox mailing list