Bugs in g++ and gcc
Daniel Wilches Maradei
dwilches@malpelo.univalle.edu.co
Fri Mar 14 15:39:00 GMT 2003
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@malpelo.univalle.edu.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
>
>
>
More information about the Gcc-bugs
mailing list