[aspectc-user] a bug if signature is like function(void)

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Tue Apr 13 13:49:45 CEST 2004


Hi Ray,

guo_zia wrote:
> 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

your last three emails described some major ac++ code generation bugs.
Thanks a lot for reporting them! I have added these problems to our
bugzilla bugtracking system (ids 169, 170, 171).

In C++ empty argument lists should be declared as '()'. '(void)' is only
accepted for compatibility with C. However, ac++ should be able to deal
with this correctly! Bug #171 is even more severe.

It would be great if you and other users who find a bug would get
themselfs a bugzilla account at http://www.aspectc.org/bugzilla/. You
would then be automatically informed about any changes in the status of
the bug (I can only add you as an email recepient if you have a bugzilla
account).

Concerning these three problems I cannot guaranty that they will be
fixed in version 0.8.1, which is scheduled for this week, but we'll do
our best :-).

Olaf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3142 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20040413/4d588fa3/attachment.bin>


More information about the aspectc-user mailing list