Skip to content

explicit casting for const #610

@rghouzra

Description

@rghouzra
#include <iostream>
#include <limits.h>

int main (int argc, char *argv[]) {
  const int a = 10;
  int *p = (int *)&a;
  return 0;
}

give

#include <iostream>
#include <limits.h>

int main(int argc, char ** argv)
{
  const int a = 10;
  int * p = static_cast<int *>(&a);
  return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions