This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/7648: Incorrect error claiming that const structure member is uninitialized


>Number:         7648
>Category:       c++
>Synopsis:       Incorrect error claiming that const structure member is uninitialized
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 20 05:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Andris Pavenis
>Release:        gcc-3.2 release
>Organization:
>Environment:
Linux (gcc-3.2 compiled for target i386-slackware-gnu),
DJGPP (target i586-pc-msdosdjgpp)
>Description:
gcc-3.2 release (and also gcc-3.2.1 20020819 (prerelease)) incorrectly emmits the error about uninitialized const structure member (see attached example) which is really
initialized in constructor.

Example compiles OK with gcc-3.1 release

Included example is a small fragment (with unnecessary stuff removed) from file fam-2.6.9/Fam/Scheduler.c++ from package 
fam-2.6.9

Output from gcc (options -v -c):

Reading specs from /usr/lib/gcc-lib/i386-slackware-linux/3.2/specs
Configured with: ../gcc-3.2/configure --prefix=/usr --enable-shared --with-gnu-ld --enable-threads --verbose --target=i386-slackware-linux --host=i386-slackware-linux
Thread model: posix
gcc version 3.2
 /usr/lib/gcc-lib/i386-slackware-linux/3.2/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=0 -D__GXX_ABI_VERSION=102 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i386__ bad-20020820.cc -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS -quiet -dumpbase bad-20020820.cc -version -o /tmp/ccWajwNt.s
GNU CPP version 3.2 (cpplib) (i386 Linux/ELF)
GNU C++ version 3.2 (i386-slackware-linux)
	compiled by GNU C version 3.2.
ignoring nonexistent directory "/usr/i386-slackware-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.2
 /usr/include/c++/3.2/i386-slackware-linux
 /usr/include/c++/3.2/backward
 /usr/local/include
 /usr/lib/gcc-lib/i386-slackware-linux/3.2/include
 /usr/include
End of search list.
bad-20020820.cc:16: uninitialized const member `IOTypeInfo::iotype'

Andris
>How-To-Repeat:
Try compile included example with gcc-3.2 (compiler options
does not matter)
>Fix:

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

dHlwZWRlZiB2b2lkICgqSU9IYW5kbGVyKShpbnQgZmQsIHZvaWQgKmNsb3N1cmUpOwoKc3RydWN0
IEZESW5mbyB7CiAgICBzdHJ1Y3QgRkRJT0hhbmRsZXIgewogICAgICAgIElPSGFuZGxlciBoYW5k
bGVyOwogICAgICAgIHZvaWQgKmNsb3N1cmU7CiAgICB9IHJlYWQsIHdyaXRlOwp9OwoKc3RydWN0
IElPVHlwZUluZm8gewogICAgRkRJbmZvOjpGRElPSGFuZGxlciBGREluZm86Oipjb25zdCBpb3R5
cGU7CiAgICBJT1R5cGVJbmZvKEZESW5mbzo6RkRJT0hhbmRsZXIgRkRJbmZvOjoqIGFfaW90eXBl
KSA6CiAgICAgICAgICAgIGlvdHlwZShhX2lvdHlwZSkgeyB9Cn07CgpJT1R5cGVJbmZvIGZvbyAo
JkZESW5mbzo6d3JpdGUpOwogICAgCg==


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]