CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

PCW IDE brace-matching bug?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
object01



Joined: 13 May 2004
Posts: 90
Location: Nashville, TN

View user's profile Send private message Send e-mail Visit poster's website

PCW IDE brace-matching bug?
PostPosted: Thu May 13, 2004 1:01 pm     Reply with quote

I can't believe I'm the only one having this problem, but I can't find any other posts about it. My braces aren't matching correctly 50% of the time, though the code compiles fine (no missing braces). Often I'll press CTRL+] while the cursor is to either side of a paren or brace, and nothing happens. If I find the closing brace myself, then press CTRL+], the IDE jumps to the opening brace fine, but won't jump back.

Now, in situations where I can jump to a closing brace, I've also noticed that on closing brace lines that have comments afterwards, the IDE will overshoot the closing brace by a few spaces if tabs are used to indent the closing brace. If spaces are used, it works fine.

This is a brand new installation of PCW, IDE version 3.43, and this is my first time using PCW. I'm running it on a Win98 SE machine. Is this a known issue?
Kenny



Joined: 07 Sep 2003
Posts: 173
Location: Australia

View user's profile Send private message

PostPosted: Thu May 13, 2004 5:19 pm     Reply with quote

I also use IDE version 3.43 under Win98SE. You also need to state the PCM version (it's under Help - About).
With PCM version 3.188 it works fine. Also, if you click on a brace, it and the corresponding brace should highlight in green for a moment.

A few PCM versions ago there was a problem with the braces - if a closing brace was left off, the compiler sometimes would not throw up an error.
Took a while to realise what was happening!
Darren Rook



Joined: 06 Sep 2003
Posts: 287
Location: Milwaukee, WI

View user's profile Send private message Send e-mail

PostPosted: Thu May 13, 2004 8:11 pm     Reply with quote

Look at this:

Code:

1: #if DEFINED_CONST
2:   while (!done) {
3: #else
4:   while ((!done)&&(otherstuff)) {
5: #endif
6:         //code//
7:  }


The IDE isn't smart enough to know that this is conditionaly compiled. If you goto line 4 and goto the end bracket it will goto line 7. If you goto line 2 and goto the end bracket it will go to the next closing bracket even though it doesn't match.

This is the only 'bug' with bracket match feature that I know.
object01



Joined: 13 May 2004
Posts: 90
Location: Nashville, TN

View user's profile Send private message Send e-mail Visit poster's website

Example Code
PostPosted: Fri May 14, 2004 7:43 am     Reply with quote

The following code fragment illustrates the behavior in PCM 3.189.

* I cannot match to the closing brace on main(), but I can match to its opening brace.
* Likewise with the first do {} block
* Matching to the closing brace of the if{} block overshoots the closing brace by a couple of spaces.

Removing the puts() line fixes the problem.

--
Jeff S.


Code:
void main (void)
{
   do {
      do {
      } while ((temp_str[0] != 'A') && (attempts < 20));

      if (temp_str[0] != 'A') {
      } else {
      };

      puts ("AT+CMGS=\"xxxxxxxxxx\"", PHONE);
   } while (TRUE);

}
Darren Rook



Joined: 06 Sep 2003
Posts: 287
Location: Milwaukee, WI

View user's profile Send private message Send e-mail

PostPosted: Fri May 14, 2004 8:06 am     Reply with quote

The IDE is confused by the \".
object01



Joined: 13 May 2004
Posts: 90
Location: Nashville, TN

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri May 14, 2004 9:01 am     Reply with quote

Darren Rook wrote:
The IDE is confused by the \".


Well since nobody has indicated that this is a known issue, I guess I'll submit a bug report.

--
Jeff S.
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Fri May 14, 2004 10:27 am     Reply with quote

object01 wrote:
Darren Rook wrote:
The IDE is confused by the \".


Well since nobody has indicated that this is a known issue, I guess I'll submit a bug report.

--
Jeff S.


I a bit confused myself. What is that line suposed to do?
object01



Joined: 13 May 2004
Posts: 90
Location: Nashville, TN

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri May 14, 2004 11:49 am     Reply with quote

Neutone wrote:
I a bit confused myself. What is that line suposed to do?


The issue is that the IDE fails to match braces correctly in some circumstances, paricularly if an escaped " is included in a string. The code included toward the beginning of the thread illustrates the problem.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group