Menu

#133 void pointer not incremented

closed-invalid
nobody
None
5
2013-05-25
2001-09-09
No

extern func( void* a );

void main( void )
{
void* x=0;

func(x);
++x; /* x should be 1 now */
func(x);
}

In the above example, x is not incremented. Previous
versions of SDCC actually incremented x by 4.

Tested with MingW snapshot of september 8.
Compiler flags: -mz80 -c

Related

Bugs: #4056

Discussion

  • Sandeep Dutta

    Sandeep Dutta - 2001-09-09
    • milestone: --> non_bugs
    • status: open --> closed-invalid
     
  • Sandeep Dutta

    Sandeep Dutta - 2001-09-09

    Logged In: YES
    user_id=1551

    this is an invalid testcase. pointer arithmetic
    ptr++ means ptr += (sizeof(*ptr)). sizeof(void) == 0.

     

Log in to post a comment.