From: <no...@so...> - 2002-09-04 15:22:18
|
Bugs item #604575, was opened at 2002-09-04 12:22 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=604575&group_id=599 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Felipe Massia Pereira (felmasper) Assigned to: Nobody/Anonymous (nobody) Summary: ptr ++ with cast and derref Initial Comment: GCC compiles this in ANSI mode. ~/test $ cat ptr++.c #include <stdio.h> char x[4] = { 1, 2, 3, 4 }; int acc, i; int *p; void main() { acc = 0; p = (int *) x; for (i=0; i<2; i++) acc += *((int *)p)++; printf("%d\n",acc); } ~/test $ sdcc -mz80 ptr++.c ptr++.c:13: error: 'lvalue' required for '++' operation . ptr++.c:15: error: code not generated for 'main' due to previous errors ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=604575&group_id=599 |