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++/6248: gcc 2.95.3 and 3.0.4 accept bool assigned to bool * function parameter



>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


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