public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/4093: Return type mis-match for (a?b:c) constructs in gcc/cp/cp-tree.h
@ 2001-08-23  7:16 rkl
  0 siblings, 0 replies; 2+ messages in thread
From: rkl @ 2001-08-23  7:16 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4093
>Category:       c++
>Synopsis:       Return type mis-match for (a?b:c) constructs in gcc/cp/cp-tree.h
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 23 07:16:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     rkl@connect.org.uk
>Release:        unknown-1.0
>Organization:
>Environment:
HP-UX 11.00 (may apply to other platforms with "strict"
ANSI C compilers)
>Description:
HP-UX's ANSI C compiler likes the conditional (a?b:c) construct
to have matching types for the return values b and c (which
is sensible, you'd agree :-) ). In gcc/cp/cp-tree.h, there
is a mismatch in the #define's for SET_BINFO_MARKED(),
CLEAR_BINFO_MARKED(), SET_BINFO_VTABLE_PATH_MARKED() and
CLEAR_BINFO_VTABLE_PATH_MARKED() (lines 1668, 1669, 1674
and 1675).

It turns out that the "true" part ("b" if you like)
returns a (void), but the "false" part ("c") doesn't.
>How-To-Repeat:
Compile gcc 3.0.1 with a strict ANSI C compiler - I used
the HP-UX 11.00 HP ANSI C compiler for this.
>Fix:
Cast the "else" part ("c") to a (void). For example:

#define SET_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(void)(TREE_LANG_FLAG_0(NODE)=1))
>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: c++/4093: Return type mis-match for (a?b:c) constructs in gcc/cp/cp-tree.h
@ 2002-02-24 11:09 rodrigc
  0 siblings, 0 replies; 2+ messages in thread
From: rodrigc @ 2002-02-24 11:09 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, rkl

Synopsis: Return type mis-match for (a?b:c) constructs in gcc/cp/cp-tree.h

State-Changed-From-To: open->closed
State-Changed-By: rodrigc
State-Changed-When: Sun Feb 24 11:01:16 2002
State-Changed-Why:
    You shouldn't really be using the HP-UX compiler to
    compile the GNU C++ front-end, but I applied your patch.
    http://gcc.gnu.org/ml/gcc-patches/2002-02/msg01672.html

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


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

end of thread, other threads:[~2002-02-24 19:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-23  7:16 c++/4093: Return type mis-match for (a?b:c) constructs in gcc/cp/cp-tree.h rkl
2002-02-24 11:09 rodrigc

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