ANSI C(1999), ANSI C++(1998)에 의하면
아래 코드는 valid하답니다.
The following program is valid in both C99 and C++:
%:include <stdio.h>
%:ifndef BUFSIZE
%:define BUFSIZE 512
%:endif
void copy(char d<::>, const char s<::>, int len)
<%
while (len-- >= 0)
<%
d<:len:> = s<:len:>;
%>
%>
int int_compare(int i, int j)
<%
if( i not_eq j )
return 1;
else
return 0;
%>
[C99: §6.4.6]
[C++98: §2.5, 2.12]
근데 과연 이걸 컴파일할 수 있는 C/C++ 컴파일러가 있을지...-_-;;;
일단 GCC 2.95.2랑 빌더 5.0에서는 실패했습니다.
PS: CodeWarrior Professional 7.0에서는 제대로 컴파일이 되네요.
|