This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: Bugs in g++ and gcc


On Thu, 27 Feb 2003, Nathan Sidwell wrote:

Hello Nathan,

But wath is the purpose of write function prototypes inside another 
function?

I mean, why we are allowed to write inside a main() this:
        MyClass funtion1();
But we cant implement function1

Was a bug that was left?

I hope your answer
Daniel Wilches Maradei
dwilches at malpelo dot univalle dot edu dot co


> Daniel Wilches Maradei wrote:
> 
> > I hope to get your answer, please, even if that are not real bugs, or 
> > anything.
> they are not bugs.
> 
> 
> > 
> >    char c;
> >    c='s';
> >    char *s= (char*) malloc(512);
> it is not valid C89 for a declaration to come after a statement. You need
> to use C99 mode, or reorder the declarations and statements.
> 
> 
> > // This compile with:
> > //       g++ -c error1.cpp 
> > // g++ is allowing me to declare a function inside other.
> this is normal C++
> 
> > //
> > // What can be the pourpose of this if we can declare function
> > // prototype but no body
> > 
> > //Cause of this error we cannot declare a object using a
> > //zero-parameter constructor, like this:
> > //
> > //    my_class object_1();
> Yes. that is what the language is like. You have to leave off the ().
> 
> nathan
> 
> 
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]