[VC++] TODO 메시지

  • Post author:
  • Post category:
  • Post comments:0 Comments
  • Post last modified:September 22, 2007

시간 측정하는 방법에 대해 조사하다가 재미있는 팁을 알게 됐다.

코드를 짜다가 잘 생각 안 나는 부분이 있거나 확정 안 된 요소와 마주치면 일단 \todo 주석(doxygen 기준)을 남기고 넘어간다.

문제는 주석을 달아놓고 잊어버린다는 것!

한데 매크로를 써서 빌드시에 todo 메시지가 나오게 하는 방법이 있었다. 구현 자체는 매우 간단하고 이해하기도 쉬운데, 정작 이렇게 활용할 생각을 하기는 쉽지 않은 것 같다.

// Placing the following line
// #pragma message( __TODO__ "Needs faster algorithm.")
// on line 38 of a file foo.c will produce a message like this in the
// build window:
// <Path to foo>\foo.cpp(38) : TODO: Needs faster algorithm.
//
#define __STR__(x) #x
#define __CONST_TO_STR__(x) __STR__(x)
#define __FILE_AND_LINE__ __FILE__ "("__CONST_TO_STR__(__LINE__)")"
#define __TODO__ __FILE_AND_LINE__ " : TODO: "
Author Details
Kubernetes, DevSecOps, AWS, 클라우드 보안, 클라우드 비용관리, SaaS 의 활용과 내재화 등 소프트웨어 개발 전반에 도움이 필요하다면 도움을 요청하세요. 지인이라면 가볍게 도와드리겠습니다. 전문적인 도움이 필요하다면 저의 현업에 방해가 되지 않는 선에서 협의가능합니다.
0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments