From mboxrd@z Thu Jan 1 00:00:00 1970 From: dgillies@graviton.com To: gcc-gnats@gcc.gnu.org Subject: c++/4494: Possible problem with compiler warnings on main() Date: Sun, 07 Oct 2001 01:16:00 -0000 Message-id: <20011007080638.23804.qmail@sourceware.cygnus.com> X-SW-Source: 2001-10/msg00123.html List-Id: >Number: 4494 >Category: c++ >Synopsis: Possible problem with compiler warnings on main() >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sun Oct 07 01:16:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: dgillies@graviton.com >Release: gcc version 2.95.2 19991024 (release) >Organization: >Environment: FreeBSD >Description: typedef int int_t; int_t main() { } g++ -pedantic-errors -W -Wimplicit -Wreturn-type -Wswitch -Wunused -Wall -Wshad\ ow -Wpointer-arith -Wcast-qual -Wcast-align -Waggregate-return -Wstrict-prototy\ pes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Werror -Wuni\ nitialized -Wbad-function-cast -Wwrite-strings -O2 -DNDEBUG -ggdb3 -DTARGET_IS_\ test.c:113: return type for `main' changed to `int' ============================== the G++ compiler gives this error, when I have main() returning a typedef'd int. I do not think this should be even a warning. I am using no native types in my software system, because I want to be able to port my software easily. However, -Wmain will always complain that "main" has a suspicious type. However, there is nothing suspicious about a type of "int" which happens to be a typedef. - Don Gillies >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="none" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="none"