public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/10032: -pedantic gives a warning when goto jumps over an initalization, but then dies
@ 2003-03-11 21:06 mvl
  0 siblings, 0 replies; only message in thread
From: mvl @ 2003-03-11 21:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10032
>Category:       c++
>Synopsis:       -pedantic gives a warning when goto jumps over an initalization, but then dies
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 11 21:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     mvl@exedo.nl
>Release:        3.2.2 20030109 (Debian prerelease)
>Organization:
>Environment:
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,pascal,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.2 20030109 (Debian prerelease)
>Description:
pedantic gives a warning when a jump jumps over the initialization of a var, but then dies. Without pedantic, is gives an error. The error is ok, but the warning is confusing. It should be an error too.

[michiel@epsilon temp]$ cat goto.cpp 
int main() {
  goto label;
  
  int temp = 1;
  
  label:
    return 1;
}
[michiel@epsilon temp]$ g++ -pedantic goto.cpp && echo ok
goto.cpp: In function `int main()':
goto.cpp:6: warning: jump to label `label'
goto.cpp:2: warning:   from here
goto.cpp:4:   crosses initialization of `int temp'

[michiel@epsilon temp]$ g++ goto.cpp && echo ok
goto.cpp: In function `int main()':
goto.cpp:6: jump to label `label'
goto.cpp:2:   from here
goto.cpp:4:   crosses initialization of `int temp'

[michiel@epsilon temp]$ 

(expected: echo "ok" when only warnings are given)
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-11 21:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-11 21:06 c++/10032: -pedantic gives a warning when goto jumps over an initalization, but then dies mvl

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).