This is the mail archive of the gcc-help@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]

gcc warning



  Hello,

    I have access to two versions of gcc: 2.7.2.3 (for Solaris) and 2.95.2
  (for PC system, through mingw32). For a program such as:

  void main(void)
  {
    printf("Hello world\n");
  }

   2.7.2.3 version will not give any warning, while 2.95.2 will complain
 that "main" does not return an "int", as it should. The warning will
 disappear either by removing "void" or replacing it by "int".

   Does anyone know why they behave differently? Is there any standard that
 forces "main" to return an "int", even when its return value is not
 normally used?

   Best regards,


                                                       Joaquin Ferruz

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