public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: benedictbrown@yahoo.com To: gcc-gnats@gcc.gnu.org Subject: c++/6321: no warning for bad main function declaration Date: Tue, 16 Apr 2002 05:06:00 -0000 [thread overview] Message-ID: <20020416120541.831.qmail@sources.redhat.com> (raw) >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
next reply other threads:[~2002-04-16 12:06 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-04-16 5:06 benedictbrown [this message] 2002-09-15 5:35 nathan
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020416120541.831.qmail@sources.redhat.com \ --to=benedictbrown@yahoo.com \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).