This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/11427] New: Problem with conditional expressions as l-values
- From: "bonet at cs dot ucla dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jul 2003 19:33:49 -0000
- Subject: [Bug c/11427] New: Problem with conditional expressions as l-values
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11427
Summary: Problem with conditional expressions as l-values
Product: gcc
Version: 3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bonet at cs dot ucla dot edu
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: SPARC/SOLARIS/5.8
GCC host triplet: SPARC/SOLARIS/5.8
GCC target triplet: SPARC/SOLARIS/5.8
The program below compiles fine with gcc-2.95.3
but it does not compiles with gcc-3.2, producing
the error message:
p.c: In function `main':
p.c:14: invalid lvalue in assignment
The version of gcc I am using is (as reported with -v):
Reading specs from /net/peking/caracas/usr/local/bin/../lib/gcc-lib/sparc-sun-s
olaris2.9/3.2/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as
--with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.2
------- p.c ---------
#define PAIR(x,y) ((x)<=(y) ? H2Cost[(x)][(y)-(x)] : H2Cost[(y)][(x)-(y)])
struct cost_s
{
unsigned long plus;
unsigned long max;
} cost_s;
typedef struct cost_s cost_t;
main()
{
int p,q;
cost_t **H2Cost;
PAIR(p,q).max = 0;
}