This is the mail archive of the gcc-bugs@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/5646: ternary cannot be used as an lvalue



>Number:         5646
>Category:       c
>Synopsis:       ternary cannot be used as an lvalue
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 09 14:46:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Craig Svenson
>Release:        gcc-3.0.3
>Organization:
>Environment:
powerpc-ibm-aix4.3.2.0
>Description:
I have tried using aix compiler version 3, 4, and 5 to compile decl.c. 
Every line that has this defined ternary as an lvalue fails to compile. 

#define current_binding_level                   \
  (cfun && cp_function_chain->bindings          \
   ? cp_function_chain->bindings                \
   : scope_chain->bindings)

cc -c  -DIN_GCC     -g   -DHAVE_CONFIG_H    -I. -Icp -I. -I./cp  -I./config -I./../include cp/decl.c -o cp/decl.o
"cp/decl.c", line 528.3: 1506-025 (S) Operand must be a modifiable lvalue.
"cp/decl.c", line 584.5: 1506-025 (S) Operand must be a modifiable lvalue.
"cp/decl.c", line 599.5: 1506-025 (S) Operand must be a modifiable lvalue.
"cp/decl.c", line 621.3: 1506-025 (S) Operand must be a modifiable lvalue.
"cp/decl.c", line 634.3: 1506-025 (S) Operand must be a modifiable lvalue.
"cp/decl.c", line 4294.7: 1506-025 (S) Operand must be a modifiable lvalue.
"cp/decl.c", line 4296.7: 1506-025 (S) Operand must be a modifiable lvalue.
"cp/decl.c", line 6405.3: 1506-025 (S) Operand must be a modifiable lvalue.
"cp/decl.c", line 9939.7: 1506-025 (S) Operand must be a modifiable lvalue.
"cp/decl.c", line 9942.7: 1506-025 (S) Operand must be a modifiable lvalue.
"cp/decl.c", line 13508.3: 1506-025 (S) Operand must be a modifiable lvalue.
make: 1254-004 The error code from the last command is 1.
>How-To-Repeat:

>Fix:
change this define to the following

#define current_binding_level                   \
  (*(cfun && cp_function_chain->bindings                \
   ? &cp_function_chain->bindings               \
   : &scope_chain->bindings))
>Release-Note:
>Audit-Trail:
>Unformatted:


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