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]

[Bug c/11427] New: Problem with conditional expressions as l-values


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;
}


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