Bugs in g++ and gcc

Daniel Wilches Maradei dwilches@malpelo.univalle.edu.co
Thu Feb 27 00:27:00 GMT 2003


Hello Everybody,

Compiler Version:
  Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/2.96/specs
  gcc version 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)
I dont know if this above is important but ....

I attached the two programs than cause the bugs, inside are the 
explanantions, anyway are very short programs, less than 10 lines each 
one.

I hope to get your answer, please, even if that are not real bugs, or 
anything.

Goodbye
Daniel Wilches Maradei
dwilches@malpelo.univalle.edu.co

-------------- next part --------------
#include <stdio.h>
#include <stdlib.h>

int main()
{
   /*
    * Compile with:
    *          gcc error2.c
    *
    * This program may not compile, why? i think there is something
    * wrong with the lexical specification of the gcc compiler.
    *
    * If you change the two lines:
    *    char c;"
    *    c='s';
    * For this one:
    *    char c='s';
    * All goes all-right   
    *
    */

   char c;
   c='s';
   char *s= (char*) malloc(512);

   return 0;
}

-------------- next part --------------

#include <stdlib.h>
#include <stdio.h>

// This compile with:
//       g++ -c error1.cpp 
// g++ is allowing me to declare a function inside other.
//
// 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();
//
//g++ will interpret this like the declaration of a function returning
//a my_class instance and getting no parameters.
//

int main()
{
   void vi(int, int);
   vi(4,5);
   
   return 0;
}



More information about the Gcc-bugs mailing list