c++/722: Bug in testing pointer to member functions

andreas@nameplanet.com andreas@nameplanet.com
Thu Nov 2 02:06:00 GMT 2000


>Number:         722
>Category:       c++
>Synopsis:       Bug in testing pointer to member functions
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 02 02:06:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Andreas Aardal Hanssen
>Release:        gcc-2.96
>Organization:
>Environment:
RedHat 7.0, Linux-2.2.16-22
>Description:
testing an assignment of pointer to member
functions is a test of the return value of
the member function, and not the function
pointer itself. Compiling such code with
-ansi results in warning, NULL used in
arithmetic in example code below.
>How-To-Repeat:
Compile isolated example supplied. g++ -Wall -pedantic -ansi q.cc -o q
See warning:
q.cc: In method `Wik::Wik ()':
q.cc:11: warning: NULL used in arithmetic
>Fix:
No suggestions.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="q.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="q.cc"

I2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPG1hcD4KI2luY2x1ZGUgPHN0ZGlvLmg+CgpjbGFz
cyBXaWsgewpwdWJsaWM6CiAgbWFwPHN0cmluZywgYm9vbCAoV2lrOjoqKShGSUxFICopPiBmdW5j
TWFwOwogIGJvb2wgKFdpazo6KmZvbykoRklMRSAqKTsKCiAgV2lrKCkgewogICAgLy8gR2V0cyBh
IHdhcm5pbmcgaGVyZQogICAgaWYgKChmb28gPSBmdW5jTWFwWyJmb28iXSkgIT0gTlVMTCk7Cgog
ICAgLy8gQnV0IG5vdCBoZXJlCiAgICBpZiAoKGZvbyA9IGZ1bmNNYXBbImZvbyJdKSAhPSBmYWxz
ZSk7CgogICAgLy8gU2hvdWxkIGJlIHRoZSBvdGhlciB3YXkgYXJvdW5kISEKCiAgICAvLyBDb21w
aWxlciB0aGlua3MgZnVuY01hcFsiZm9vIl0gcmV0dXJucwogICAgLy8gYSBib29sLCBhcyAnZnVu
Y01hcCcgbWFwcyB0byBib29sCiAgICAvLyBmdW5jdGlvbnMuIEl0IGlzIGFjdHVhbGx5IGEgZnVu
Y3Rpb24KICAgIC8vIHBvaW50ZXIgd2hpY2ggaXMgYXNzaWduZWQsIG5vdCB0aGUKICAgIC8vIHJl
dHVybiB2YWx1ZSBvZiB0aGUgZnVuY3Rpb24uCiAgfQp9OwoKaW50IG1haW4oaW50IGFyZ2MsIGNo
YXIgKiphcmd2KSB7Cn0K


More information about the Gcc-bugs mailing list