This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19043] New: -fpermissive gives bad loop initializations
- From: "japple at freeshell dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Dec 2004 19:40:27 -0000
- Subject: [Bug c++/19043] New: -fpermissive gives bad loop initializations
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux
int main() {
//int i;
for(int i = 1; i < 0; ++i);
for(i = 2; i < 4; ++i) {
for(int j = 3; j < 5; ++j) {
cout << i << " " << j << endl;
}
}
}
outputs
3 3
4 4
initializing i outside of the first for loop gives
2 3
2 4
3 3
3 4
--
Summary: -fpermissive gives bad loop initializations
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: japple at freeshell dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: Red Hat 3.4.3-10
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19043