'gcc4.x'에 해당되는 글 1건

  1. 2011.05.16 deprecated conversion from string constant to 'char*' 에러 처리

deprecated conversion from string constant to 'char*' 에러 처리

deprecated conversion from string constant to 'char*'
gcc 3.x 버전에서는 큰 이상이 없는데, gcc 4.x버전으로 넘어오면서 나오는 warning이다.
gcc 4.x버전에서는 스트링 상수를 char*로 형변환하는것을 권장하지 않기 때문이라는데...
해결 방법은 char* 앞에 const을 붙여주면 된다.
prev 1 next