public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/6321: no warning for bad main function declaration
@ 2002-04-16  5:06 benedictbrown
  0 siblings, 0 replies; 2+ messages in thread
From: benedictbrown @ 2002-04-16  5:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         6321
>Category:       c++
>Synopsis:       no warning for bad main function declaration
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 16 05:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     benedictbrown@yahoo.com
>Release:        unknown-1.0
>Organization:
>Environment:
RH Linux 7.2 (full install).
Tested on both gcc 2.95.3 and gcc 3.0.2
>Description:
No warning is given when the main function arguments are wrong (not argc, argv), even when -Wall is set.  The program simply seg faults when it's run.  A warning _is_ given that the return type is incorrect.

The output with -v is listed below (gcc):
Reading specs from /opt/at/gcc/3.0.2/lib/gcc-lib/i686-pc-linux-gnu/3.0.2/specs
Configured with: ../gcc-3.0.2/configure --prefix=/opt/at/gcc/3.0.2 --with-local-prefix=/opt/at/gcc/3.0.2 --with-gnu-as --with-as=/opt/at/gcc/3.0.2/bin/as --with-gnu-ld --with-ld=/opt/at/gcc/3.0.2/bin/ld --enable-cpp --enable-languages=c++ --disable-shared --disable-nls --host=i686-pc-linux-gnu
Thread model: single
gcc version 3.0.2
 /opt/at/gcc/3.0.2/lib/gcc-lib/i686-pc-linux-gnu/3.0.2/cpp0 -lang-c++ -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -v -I/edc/wa/benedict/g1_es1/csfg/ixl_gnu-assert-dbg/Tree/include -I. -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=2 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Wall -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ bert.cxx bert.ii
GNU CPP version 3.0.2 (cpplib) (i386 Linux/ELF)
ignoring nonexistent directory "/opt/at/gcc/3.0.2/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /edc/wa/benedict/g1_es1/csfg/ixl_gnu-assert-dbg/Tree/include
 .
 /opt/at/gcc/3.0.2/include/g++-v3
 /opt/at/gcc/3.0.2/include/g++-v3/i686-pc-linux-gnu
 /opt/at/gcc/3.0.2/include/g++-v3/backward
 /opt/at/gcc/3.0.2/include
 /opt/at/gcc/3.0.2/lib/gcc-lib/i686-pc-linux-gnu/3.0.2/include
 /usr/include
End of search list.
 /opt/at/gcc/3.0.2/lib/gcc-lib/i686-pc-linux-gnu/3.0.2/cc1plus -fpreprocessed bert.ii -quiet -dumpbase bert.cxx -g -ggdb -gstabs+ -Wall -version -o bert.s
GNU CPP version 3.0.2 (cpplib) (i386 Linux/ELF)
GNU C++ version 3.0.2 (i686-pc-linux-gnu)
	compiled by GNU C version 3.0.2.
bert.cxx:45: `main' must return `int'
bert.cxx:45: return type for `main' changed to `int'
>How-To-Repeat:
just compile included source
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="bert.ii"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bert.ii"

IyAzICJiZXJ0LmN4eCIKY2xhc3MgQQp7CnB1YmxpYzoKCiAgIGNsYXNzIEIKICAgewoKICAgcHVi
bGljOgoKICAgICAgY2xhc3MgQwogICAgICB7CiAgICAgIHB1YmxpYzoKICAgICAgICAgQyhpbnQg
dikge3RoaXMtPnYgPSB2O30KICAgICAgICAgQyhjb25zdCBBOjpCOjpDJiBjKSB7dGhpcy0+diA9
IGMudjt9CiAgICAgICAgIEMoKSB7dj0wO30KCiAgICAgICAgIGludCB2OwoKICAgICAgfTsKICAg
ICAgY2xhc3MgRAogICAgICB7CiAgICAgIHB1YmxpYzoKICAgICAgICAgRChpbnQgdikge3RoaXMt
PnYgPSB2OyBDIGMxKHYpOyBDIGMyKGMxKTsgYz1jMjt9CiAgICAgICAgIEQoKSB7dj0wO30KCiAg
ICAgICAgIGludCB2OwogICAgICAgICBDIGM7CiAgICAgIH07CiAgICAgIEIoaW50IHYpIHtEIGQx
KHYpIDsgZD1kMTsgYyA9IGQuYzt9CiAgICAgIEIoKSB7O30KICAgICAgQyBjOwogICAgICBEIGQ7
CiAgIH07CgogICBBKCkgezt9CiAgIEEoaW50IHYpIHtCIGIxKHYpIDsgYj1iMTt9CiAgIEIgYjsK
Cn07CgoKdm9pZCBtYWluKGludCBpbjEsaW50IGluMixpbnQgJm91dDEsaW50ICZvdXQyLGludCAm
b3V0MykKewogICBBIGEoaW4xKTsKICAgQTo6QiBiMihpbjIpOwoKICAgb3V0MSA9IGEuYi5jLnYg
KyBiMi5jLnY7CiAgIG91dDIgPSBiMi5jLnY7Cn0K


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: c++/6321: no warning for bad main function declaration
@ 2002-09-15  5:35 nathan
  0 siblings, 0 replies; 2+ messages in thread
From: nathan @ 2002-09-15  5:35 UTC (permalink / raw)
  To: benedictbrown, gcc-bugs, gcc-prs, nobody

Synopsis: no warning for bad main function declaration

State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Sun Sep 15 05:35:19 2002
State-Changed-Why:
    probably a sensible warning. main's parms are implementation
    defined

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6321


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-15 12:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-16  5:06 c++/6321: no warning for bad main function declaration benedictbrown
2002-09-15  5:35 nathan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).