🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Mr. Jolt Cola Thu, 21 Nov 1996 00:00
Re: Possible gcc bugs?
#6174
Author: Mr. Jolt Cola
Date: Thu, 21 Nov 1996 00:00
28 lines
1223 bytes
> Bhyrava Prasad wrote:
> > 
> > Hi ,
> >    I am using gcc to cross complile for 68k on a Sun.
> > gcc --version says it is 2.7-96q1.
> >     Due to some error in cut and paste , I had a piece of code
> > similar to
> >     void foo()
> >     {
> >       void foo()
> >       {
> >           int i;
> > 
> >           some_function(i);
> >           printf("hello world\n");
> >        }
> >      }
> > 
> >    And gcc compiled it just fine. Is this a bug? If not , what
> > is happening?
> 
> No, it's not a bug. Your code is correct so why do you want gcc to
> complain ?

Nested functions are legal ANSI C? I never knew this. 

	Melvin Smith
Re: Possible gcc bugs?
#6176
Author: Bhyrava Prasad
Date: Thu, 21 Nov 1996 00:00
48 lines
1957 bytes
Mr. Jolt Cola wrote:
> 
> > Bhyrava Prasad wrote:
> > >
> > > Hi ,
> > >    I am using gcc to cross complile for 68k on a Sun.
> > > gcc --version says it is 2.7-96q1.
> > >     Due to some error in cut and paste , I had a piece of code
> > > similar to
> > >     void foo()
> > >     {
> > >       void foo()
> > >       {
> > >           int i;
> > >
> > >           some_function(i);
> > >           printf("hello world\n");
> > >        }
> > >      }
> > >
> > >    And gcc compiled it just fine. Is this a bug? If not , what
> > > is happening?
> >
> > No, it's not a bug. Your code is correct so why do you want gcc to
> > complain ?
> 
> Nested functions are legal ANSI C? I never knew this.
> 
>         Melvin Smith

Please also note that the nested function had the same name, if that
makes a difference.

Also , in my original post (which I cannot find now - our NNTP feed
seems to be having some probs) , I think I reported that 
there was a newline in a string and I gave a #define as an
example. This is not where it happened. 

The newline was in a printf format string. Example:

   printf("hello
     world");

The newline accidentally got inserted in between the hello and world.
I believe this is an error , at least in ANSI C.

- Bhyrava Prasad
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads