c++/4494: Possible problem with compiler warnings on main()

dgillies@graviton.com dgillies@graviton.com
Sun Oct 7 01:16:00 GMT 2001


>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 <Donald W. Gillies>
>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"



More information about the Gcc-bugs mailing list