Skip to content

bug with cast #371 #419

Description

@ninjaro
int printf(const char *, ...);
char t[] = {0, 0, 0, 0};

void show() {
  for (int i = 0; i < 4; i++)
    printf("%d ", t[i]);
  printf("\n");
}

int main(void) {
  char *data = t;
  show();
  *(data) -= 2;
  show();
  *(unsigned *)(data) -= 2;
  show();
  return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions