Sign in

username:

password:



Not a member?

Search rabbit-semi



Search tips

Subscribe to rabbit-semi



Ads

Discussion Groups

Discussion Groups | Rabbit-Semi | Scanf library from shdesigns dont compile under Dynamic C V 10.21

This is a group for folks designing and programming embedded systems using the Rabbit Semiconductor C-programmable microcontroller. Rabbit Semi is a spin-off from Z-World who makes a variety of embedded modules and tools. This group is not affiliated with either Rabbit or Z-World, but is a user forum for sharing ideas, asking questions, flaunting knowledge, and other typical user group stuff. The Rabbit is a powerful uC, supported by a full-featured C-compiler.

Scanf library from shdesigns dont compile under Dynamic C V 10.21 - promolinux - Apr 15 17:42:39 2008

Scott, im migrating my project code from dynamic C 9.52 with cores
RCM3000 to dynamic C 10.21 with cores RCM4XXX.

Im using your sscanf.lib library. The new compiler complains:

line 217 : ERROR SSCANF.LIB : Invalid expression - need lvalue.

The code is:
while ((isspace(*line)==0) && (*line != 0))
*(((char*)args[argcnt])++)=*line++; <--- ofending line

Any idea?

TIA

Donald.
------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )


Re: Scanf library from shdesigns dont compile under Dynamic C V 10.21 - Scott Henion - Apr 15 17:55:52 2008

promolinux wrote:
> Scott, im migrating my project code from dynamic C 9.52 with cores
> RCM3000 to dynamic C 10.21 with cores RCM4XXX.
>
> Im using your sscanf.lib library. The new compiler complains:
>
> line 217 : ERROR SSCANF.LIB : Invalid expression - need lvalue.
>
> The code is:
> while ((isspace(*line)==0) && (*line != 0))
> *(((char*)args[argcnt])++)=*line++; <--- ofending line
>
> Any idea?
>
> TIA
>
> Donald.
>
Jeez, they still don't have a sscanf?

Download the latest, it will compile.

This is another bug in 10.x ;(

--
------------------------------------------
| Scott G. Henion| s...@shdesigns.org |
| Consultant | Stone Mountain, GA |
| SHDesigns http://www.shdesigns.org |
------------------------------------------
Rabbit libs: http://www.shdesigns.org/rabbit/
today's fortune
A clash of doctrine is not a disaster -- it is an opportunity.
------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Scanf library from shdesigns dont compile under Dynamic C V 10.21 - promolinux - Apr 15 18:31:00 2008

--- In r...@yahoogroups.com, Scott Henion wrote:

> Jeez, they still don't have a sscanf?

Nope.

>
> Download the latest, it will compile.

Im using the latest file, downloaded from your website, creation date
8/06/2004. This is the latest?

> This is another bug in 10.x ;(

Seems like, yes.

TIA.

Donald .

------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Re: Scanf library from shdesigns dont compile under Dynamic C V 10.21 - Scott Henion - Apr 15 19:47:08 2008

promolinux wrote:
>
>> Download the latest, it will compile.
>>
>
> Im using the latest file, downloaded from your website, creation date
> 8/06/2004. This is the latest?
>
I uploaded a new one today as soon as you posted the message.

--
------------------------------------------
| Scott G. Henion| s...@shdesigns.org |
| Consultant | Stone Mountain, GA |
| SHDesigns http://www.shdesigns.org |
------------------------------------------
Rabbit libs: http://www.shdesigns.org/rabbit/
today's fortune
When a girl marries she exchanges the attentions of many men for the
inattentions of one.
-- Helen Rowland


(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Scanf library from shdesigns dont compile under Dynamic C V 10.21 - promolinux - Apr 15 20:21:39 2008

--- In r...@yahoogroups.com, Scott Henion wrote:

> I uploaded a new one today as soon as you posted the message.

Sorry, my mistake.

It compile now, thanks a lot.

Donald.
------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Scanf library from shdesigns dont compile under Dynamic C V 10.21 - Bill_CT - Apr 16 22:46:20 2008

--- In r...@yahoogroups.com, Scott Henion wrote:
> > *(((char*)args[argcnt])++)=*line++; <--- ofending line
>
> Download the latest, it will compile.

What did you have to change (that you shouldn't have had to change)?
That was perfectly valid C code as is (was).

Bill
------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Re: Scanf library from shdesigns dont compile under Dynamic C V 10.21 - Scott Henion - Apr 16 23:05:22 2008

Bill_CT wrote:
> --- In r...@yahoogroups.com, Scott Henion wrote:
>
>>> *(((char*)args[argcnt])++)=*line++; <--- ofending line
>>>
>> Download the latest, it will compile.
>>
>
> What did you have to change (that you shouldn't have had to change)?
> That was perfectly valid C code as is (was).
>
>

Was:

*(((char*)args[argcnt])++)=*line++;

Changed to:

char * s;
s=(char *)args[argcnt];
*s++=*line++;

It was valid code. Ugly, but valid.

I bet it was this part:

((char*)args[argcnt])++

basically (x)++ where x is not just a simple scalor but an array and a cast must be a bear to handle in the compiler.

It is ugly code I wrote for a pre-ANSI compiler back in 1988. Never thought I would reuse the code as it is so outdated. Today, I'd use ANSI variable arg list macros, but this is DC any you have to use 20 year old practices. ;)

--
------------------------------------------
| Scott G. Henion| s...@shdesigns.org |
| Consultant | Stone Mountain, GA |
| SHDesigns http://www.shdesigns.org |
------------------------------------------
Rabbit libs: http://www.shdesigns.org/rabbit/
today's fortune
The point is that descriptive writing is very rarely entirely accurate and
during the reign of Olaf Quimby II as Patrician of Ankh some legislation
was passed in a determined attempt to put a stop to this sort of thing and
introduce some honesty into reporting. Thus, if a legend said of a notable
here that "all men spoke of his prowess" any bard who valued his life would
add hastily "except for a couple of people in his home village who thought
he was a liar, and quite a lot of other people who had never really heard
of him."
-- (Terry Pratchett, The Light Fantastic)


(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Scanf library from shdesigns dont compile under Dynamic C V 10.21 - Donald Shimoda - May 16 9:24:49 2008

--- In r...@yahoogroups.com, Scott Henion wrote:
> It was valid code. Ugly, but valid.
>

Scot, i have bad news, the new version dont work as expected under
version 9.21 (i cannot test rigth now in version 10.xx, because i dont
will use RCM4XXX due to several reasons).

Example:

That line of code:

sscanf(datopc,"%s %s %s",param1,param2,param3);

with datopc = 'GET CLOCK'

in previous version returns:

param1 = 'GET'
param2 = 'CLOCK'

in actual version returns:

param1 = 'GET008(moregarbage)'
param2 = 'CLOCK0(moregarbage)'

I just come back to previous version (i love svn, do you?)

Just wanna tell you, im sure you will find where is the problem.

Best regards.

Donald.

------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )