public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/4094: LHS conditional in assignment in gcc/cp/decl.c
@ 2002-11-29 19:06 bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2002-11-29 19:06 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, rkl

Synopsis: LHS conditional in assignment in gcc/cp/decl.c

State-Changed-From-To: feedback->closed
State-Changed-By: bangerth
State-Changed-When: Wed Nov 20 18:58:16 2002
State-Changed-Why:
    No feedback in a long time. Report is about use of
      (a?b:c) = 0;
    which is not understood by local compiler. However, the
    report claims that this is a problem for some file in the
    cp directory, which should be compiled by gcc only anyway,
    right?

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


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

* Re: c++/4094: LHS conditional in assignment in gcc/cp/decl.c
@ 2001-09-02  1:50 rodrigc
  0 siblings, 0 replies; 3+ messages in thread
From: rodrigc @ 2001-09-02  1:50 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, rkl

Synopsis: LHS conditional in assignment in gcc/cp/decl.c

State-Changed-From-To: open->feedback
State-Changed-By: rodrigc
State-Changed-When: Sun Sep  2 01:50:23 2001
State-Changed-Why:
    Can you create a proper patch, and submit it
    to gcc-patches@gcc.gnu.org, and update this PR?
    
    The guidelines for submitting a patch to gcc 
    are at:
    http://gcc.gnu.org/contribute.html

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4094&database=gcc


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

* c++/4094: LHS conditional in assignment in gcc/cp/decl.c
@ 2001-08-23  7:26 rkl
  0 siblings, 0 replies; 3+ messages in thread
From: rkl @ 2001-08-23  7:26 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4094
>Category:       c++
>Synopsis:       LHS conditional in assignment in gcc/cp/decl.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 23 07:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     rkl@connect.org.uk
>Release:        3.0.1
>Organization:
>Environment:
HP-UX 11.00, HP ANSI C - other strict K&R/ANSI C compilers
may comaplain too.
>Description:
With HP's ANSI C in HP-UX 11.00, you're not allowed this
construct:

(a?b:c) = 0;

In other words, conditional LHS assignments are prohibited.

Unfortunately, gcc/cp/decl.c is scattered throughout with
them, all relating to the current_binding_level macro,
which appears on the LHS of an assignment about a dozen
times.
>How-To-Repeat:
Compile 3.0.1 with a strict K&R or ANSI C compiler - I used
HP's ANSI C in HP-UX 11.00 for this.
>Fix:
I created a new macro just below the #define current_binding_level line:

#define assign_current_binding_level(rhs)       \
  if (cfun && cp_function_chain->bindings)      \
   cp_function_chain->bindings=rhs;             \
   else scope_chain->bindings=rhs

I then found every occurrence of current_binding_level on
the LHS of an assignment and replaced it with a call
to the new macro instead. For example:

Line 528 was:

  current_binding_level = newlevel;

and is now:

  assign_current_binding_level(newlevel);


>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2002-11-21  2:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-29 19:06 c++/4094: LHS conditional in assignment in gcc/cp/decl.c bangerth
  -- strict thread matches above, loose matches on Subject: below --
2001-09-02  1:50 rodrigc
2001-08-23  7:26 rkl

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