#include 에서 매크로 확장시 C 표준
글쓴이: 체스맨 / 작성시간: 금, 2010/02/05 - 10:38오전
다음과 같은 경우는 표준에서 정의하는 것으로 판단이 됩니다.
#define MYHEADER "myheader.h" #include MYHEADER
그렇다면 다음과 같은 경우는 허용될까요? 실제로 gcc 와 msvc 6.0 모두에서 컴파일 됩니다.
#define BASEPATH <base #include BASEPATH/myheader.h>
다음과 같은 경우는 gcc에서는 되고 msvc 6.0 에서는 안됩니다.
#define BASEPATH <base #define MYHEADER myheader.h> #include BASEPATH/MYHEADER
어디까지 표준이 허용하는 것으로 보면 될까요?
Forums:
ISO/IEC 9899:1999 씀:6.10.2
표준에 정해진 제한은 없고(일반적인 전처리의 제약과 같고), VC++ 6.0 전처리기의 한계로 보입니다.
> What is the difference between software and hard water?
} Bugs drown in hard water, but live forever in software.
Real programmers /* don't */ comment their code.
If it was hard to write, it should be /* hard to */ read.
댓글 달기