AT&T Broadband Service AT&T Message Center  
AT&T Broadband Internet Navigation
Get E-mail | Message List | Compose | | Address Book | Mailboxes | Options | Help | Logout
  Logged in as: lowell.boggs Message: 5 of 15
  Mailbox: lowell.boggs on AT&T Broadband Internet  
  Folder: COVTOOL
Read Message    
  
From: <rodmorris@ozemail.com.au>  [ Save address ]
To: lowell.boggs@attbi.com
Subject: bug in covtool-1.11
Date: Fri, 7 Feb 2003 14:50:22 +1100
Firstly, I'm glad I found your tool, and I like your reporting tools, too.

Covtool has a bug in its handling of do...while loops, in my case this was a 
problem inside an if statement without braces.

For example, the code fragments

  if (1)
    do 
    {
      cerr << "hello" ;
      cerr << endl;
    } while (0);

and

  if (1)
    do
    {
      cerr << " world" ;
      cerr << endl;
    } while (0);
  else
    cerr<<" friend"<<endl;

will not compile after being instrumented with covtool (syntax error).  Using a 
debugger on covtool and looking at the instrumented file, it looks to me like 
covtool is not outputting the semicolon after the parentheses of the while when 
it finishes processing the do loop, and is holding it off until after it 
finishes the if statement.  That extra semicolon then also stuffs up the else 
statement.

I made myself a temporary fix, but I'm sure you'd make something a little more 
robust.

Just before the return statement in process_do, I put in the following code to 
consume and output the semicolon after the parentheses of the while.
  
  if(instrumenting) cout << ";";
  t = get_token(t.second,end);

Of course, you can see how non-robust this looks, and I'm not sure it breaks 
anything else (but it does appear to work for me).

Hope this helps.
Rodney

This message was sent through MyMail http://www.mymail.com.au


    
 
Get E-mail | Message List | Compose | Address Book | Mailboxes | Options | Printable View
Help | Logout | AT&T Broadband Internet Home
 
Home My AT&T E-mail Personal Web Pages Chat and message boards at AT&T Community Port Shop AT&T Broadband Help Member Services