Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

RE: Strcmp() problem stepping through AVR Studio (Never Mind)

RE: Strcmp() problem stepping through AVR Studio (Never Mind)

2005-04-11 by wbounce

Never mind dumb typo on my part. I had a ; after the ) of the if on the
ones that did the assignment. I should have looked at the disassembler
earlier 
Show quoted textHide quoted text
-----Original Message-----
From: wbounce [mailto:wbounce@safeplace.net] 
Sent: Sunday, April 10, 2005 10:51 PM
To: 'AVR-Chat@yahoogroups.com'
Subject: Strcmp() problem stepping through AVR Studio


If have serveral strcmp statements

Originally I had them all like this.

if (strcmp("GPGGA",gcBuffer) == 0)
	{
	gpFieldPtr=(PGM_P) GGA;
	} 	

It would execute the pointer assignment on each of the 8 statements

I changed them to 

lnResult = strcmp("GPGLL",gcBuffer); 
if (lnResult == 0)
	{
	gpFieldPtr=GLL;
	}  

So I could see the result code of strcmp. This time it skipped the 1st 3
ok but then started doing the assignments. And when it got to the strcmp
that should have matched, lnResult was not 0 and yet it did the
assignment anyhow.

Anyone have any idea why?

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.