[aspectc-user] a bug if signature is like function(void)
guo_zia
guo_zia at yahoo.com.cn
Fri Apr 9 05:27:46 CEST 2004
hi:
I found a bug if method have no parameter but designate it with void:function(void).
eg.
main.cc
#include <stdio.h>
class Point{
int m_x,m_y;
public:
Point(int x,int y):m_x(x),m_y(y){}
void Print(void){printf("point(%d,%d)",m_x,m_y);}
};
int main(void)
{
Point p(1,2);
p.Print();
return(0);
}
t1.ah:
#include <stdio.h>
aspect Point1{
pointcut calls() = call("% %::Print(...)");
advice calls():before(){
printf("\n begin call Print\n");
}
advice calls():after(){
printf("\n end call Print\n");
}
};
after manipulate.
bcc32 -P main.cc
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
main.cc:
Error E2468 t1/main.cc 19: Value of type void is not allowed
Error E2227 t1/main.cc 21: Extra parameter in call to Point::Print() in function __call_main_0_0(Point *,void)
Error E2193 t1/main.cc 30: Too few parameters in call to '__call_main_0_0(Point *,void)' in function main()
*** 3 errors in Compile ***
i found in manipulated main.cc there is a "inline void __call_main_0_0 (::Point *dstthis, void arg0)"
apparently"void arg0" is wrong.
Yours truly,
Ray.
guo_zia at yahoo.com.cn
---------------------------------
Do You Yahoo!?
惠普TT游戏剧,玩游戏,中大奖!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20040409/bf629c9a/attachment.html>
More information about the aspectc-user
mailing list