This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Re: Bugs in g++ and gcc
- From: Daniel Wilches Maradei <dwilches at malpelo dot univalle dot edu dot co>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: Daniel Wilches Maradei <dwilches at malpelo dot univalle dot edu dot co>, <gcc-bugs at gcc dot gnu dot org>
- Date: Fri, 14 Mar 2003 09:47:41 -0500 (COT)
- Subject: 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
>
>
>