bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

warning treated as error with -Wall?


From: Dale Elisabeth Atems
Subject: warning treated as error with -Wall?
Date: Fri, 18 May 2001 14:00:26 -0400 (EDT)

--9Jbi60mUAX
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello bug team,

In gcc version 2.96 20000731 (Red Hat Linux 7.0), compiling the
attached source file with the command line

g++ -Wall test.cc

results in the message

test.cc:5: return type for `main' changed to `int'

and an exit status of 1 but no a.out, contrary to the man page which
says

       -Wall  Issue warnings  for  conditions  which  pertain  to
              usage  that  we  recommend  avoiding  and  that  we
              believe is easy to avoid, even in conjunction  with
              macros.

i.e. warnings, not errors. With the command line

g++ test.cc

a correctly behaving a.out is produced and no warning is issued.

-- 
D. Elisabeth Atems, Ph.D. <address@hidden>  phone 313-577-1203
Department of Physics and Astronomy                  fax   313-577-3932
Wayne State University, Detroit, MI



--9Jbi60mUAX
Content-Type: text/plain
Content-Disposition: inline;
        filename="test.cc"
Content-Transfer-Encoding: 7bit

#include <stdlib.h>
#include <iostream.h>

void main ( int argc, char *argv[] )
{
        cout << "Hello world.\n";
        exit(0);
}

--9Jbi60mUAX--



reply via email to

[Prev in Thread] Current Thread [Next in Thread]