public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/6248: gcc 2.95.3 and 3.0.4 accept bool assigned to bool * function parameter
@ 2002-04-25  7:07 nathan
  0 siblings, 0 replies; 2+ messages in thread
From: nathan @ 2002-04-25  7:07 UTC (permalink / raw)
  To: akjones, gcc-bugs, gcc-prs, nobody

Synopsis: gcc 2.95.3 and 3.0.4 accept bool assigned to bool * function parameter

State-Changed-From-To: open->closed
State-Changed-By: nathan
State-Changed-When: Thu Apr 25 07:07:40 2002
State-Changed-Why:
    not a bug. 'false' is an integral constant expression of
    value zero i.e. a null pointer constant. This is unfortunate,
    for the reasons you give, but not wrong

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6248


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c++/6248: gcc 2.95.3 and 3.0.4 accept bool assigned to bool * function parameter
@ 2002-04-10 10:56 akjones
  0 siblings, 0 replies; 2+ messages in thread
From: akjones @ 2002-04-10 10:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         6248
>Category:       c++
>Synopsis:       gcc 2.95.3 and 3.0.4 accept bool assigned to bool * function parameter
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 10 10:56:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     akjones@ece.northwestern.edu
>Release:        2.8.1, 2.95.3, 3.0.4
>Organization:
>Environment:
Sun Solaris 8
>Description:
g++ from 2.95.3 and 3.0.4 allow passing a constant parameter "false" to a function with bool * parameter without complaint.  There is a complaint when true is passed rather than false:

foo.cc: In function `int main()':
foo.cc:7: passing `bool' to argument 1 of `foo(bool *)' lacks a cast

gcc-2.8.1 complains either way with the following:
foo.cc: In function `int main()':
foo.cc:7: argument passing to `bool *' from `bool'

>How-To-Repeat:
compile foo.cc with g++ from 2.8.1 and 2.95.3 to see compiler errors
>Fix:
Well, the fix is obviously to write correct code, however, it seems like the compiler should probably detect this problem.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-gzip-compressed; name="foo.tar.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="foo.tar.gz"

H4sIAEp6tDwAA+1ZXW/aMBTl1fkVHgiJbpDZzgdt97QxQJW6turUp2lCIZguXYhRkn5t2n+f7QQS
IIhVa7Jq+DyQm+sb5x4713EORD/U8dtaqUDIRF3L4kdidG3CjwjZli2PKWqoa1oWj0KGWUOYIBvX
oFVuWgluo9gJIaw5329YQKOtcfQIjZ2AhjeUVpFWVSBy/qeM6a5b1j0Q5vNtmtvn3+5m84/5s4AN
bFo1iMpKKI89n/875k0gn/7WmDEfvh4fwJ+a9kvTvCCGM8cLWtIBZcjU8SN68E60/+u0FZ4JWf17
Xln32FX/GJm59d+Q9c+bVf1XgAbEsJ4s/3VNLQZ7h6z+tz/6f4sd9U8M21jb/xnIwKr+qwDQp55P
wXIJuHZdMnLZbM69E/1Y0yPqxh4LQF2P6UNc14Du+N51AE1uXfts7PhiORiNBhdj7okf5xQsHe3G
9DaQl/OmechcgAjSFq2889PTwQd8rIFXjYvL89Pz4VW/AZEGIueOwmY0b3cwJm1uiMje4ASthWIe
GsOmh9pfmtP5G/vwqwbGkMcSDQRsnp7g5ES45S3FDUMai58oZiGVafSxbJtS0apH3o88jaShk+O5
MQZieVzyFycF3E1NNKS0yZ/TXh8hTmjG7iBqc+YpR2PJ0ShkR1J2JGMnk0ycHZl9fq7pt9E0dGa0
3m44vs/cduM+9GKqcf6X7z/1Rx/6w5Oz0Uj0duvcs3ACeE/93kkfd7jxWRjawsgFoQeesD5+jCk3
cWYWe7tuZttWZufctLCPo+LrprmJW6S7xmDwMWUgDG1hrAZJV2dtJFYi+EO9ep50mrjTZMyVCPFw
b4RMcqOSI0omO5nidaqbLITLWFA1FlSNTarGDqpkjSrpLN3bqOKNkOelKll4ExrEoD7s9Y5ha3h2
dQDlu66utit5EP3I0o1yBaAn6T9dqf9gHq70nwqQzn+pAtAT9B/TRlL/Iaba/1UC9cm338jVf2kC
0BP0H9PmH36i/i1V/5VA6T/7jVz9lyYA7dJ/THuj/jFR//9Ugher/wAhhECphMAdChAQChDMSUAg
UURgogGBRBCCmUCSSEEvVwQq5l4sAwFOvcn4ha7j+2CZregq4b+IkVqRGAszGwtTiUVKLFJiUbFY
JF6MkIjtqYEt2AqpTx2+5VECkoKCwv+B303WmkgAKAAA


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-04-25 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-25  7:07 c++/6248: gcc 2.95.3 and 3.0.4 accept bool assigned to bool * function parameter nathan
  -- strict thread matches above, loose matches on Subject: below --
2002-04-10 10:56 akjones

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