Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: ****tabilit...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 14 of 36 Topic 26061 of 26977
Post > Topic >>

Re: ****tability: Harmony between PC and microcontroller

by Keith Thompson <kst-u@[EMAIL PROTECTED] > May 6, 2008 at 12:28 PM

Tomás Ó hÉilidhe <toe@[EMAIL PROTECTED]
> writes:
> On May 6, 12:33 pm, Chris Dollin <chris.dol...@[EMAIL PROTECTED]
> wrote:
>> That just means that those microcontrollers aren't a natural fit
>> to C, so programmers writing looks-like-C for them need to be
>> aware that natural-C idioms might not work as nicely.
>
>
> This is what I'm against. When I first started programming in C for
> embedded systems, I was weary of the compiler's compliance to the

(I presume you mean "wary", not "weary".)

> Standard. I was hesitant to rely on rules from the Standard when it
> came to things like:
>     * Minimum size of integer types

Nitpick: The standard defines minimum ranges for integer types, but
the effect is the same.

I've heard of C-like compilers that provide a type "int" with a range
narrower than -32767 .. +32767.  That's ok, as long as there's no
claim that it conforms to the C standard.  But I would expect the
compiler's do***entation to *clearly* state the ways in which it fails
to conform.

>     * Behaviour of overflow

For floating-point and signed integers, the standard doesn't define
the behavior of overflow.  For unsigned integers, the required
behavior is well defined; it wraps around modulo 2**N.  I'd be
surprised if even a non-conforming C-like compiler didn't do this (it
should be straightforward to implement in hardware).  But again, if
the behavior differs from what the standard specifies, I'd expect it
to be clearly stated in the do***entation.

>     * Existance and usage of a stack

The C standard doesn't even use the word "stack" (and *please* let's
not re-open the argument about what "stack" means).  It does require
that functions can be called recursively.  If the implementation can't
sup****t that, then again, I'd expect that to be clearly do***ented.

[snip]

-- 
Keith Thompson (The_Other_Keith) <kst-u@[EMAIL PROTECTED]
>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
 




 36 Posts in Topic:
Portability: Harmony between PC and microcontroller
=?ISO-8859-1?Q?Tom=E1s_=D  2008-05-04 18:16:43 
Re: Portability: Harmony between PC and microcontroller
Jack Klein <jackklein@  2008-05-04 21:42:18 
Re: Portability: Harmony between PC and microcontroller
CBFalconer <cbfalconer  2008-05-05 02:45:49 
Re: Portability: Harmony between PC and microcontroller
Martin Ambuhl <mambuhl  2008-05-05 03:38:34 
Re: Portability: Harmony between PC and microcontroller
CBFalconer <cbfalconer  2008-05-05 19:03:03 
Re: Portability: Harmony between PC and microcontroller
"Bartc" <bc@  2008-05-05 10:07:18 
Re: Portability: Harmony between PC and microcontroller
Keith Thompson <kst-u@  2008-05-05 09:28:46 
Re: Portability: Harmony between PC and microcontroller
=?ISO-8859-1?Q?Tom=E1s_=D  2008-05-05 06:57:18 
Re: Portability: Harmony between PC and microcontroller
CBFalconer <cbfalconer  2008-05-05 19:09:27 
Re: Portability: Harmony between PC and microcontroller
Chris Dollin <chris.do  2008-05-06 12:33:20 
Re: Portability: Harmony between PC and microcontroller
=?ISO-8859-1?Q?Tom=E1s_=D  2008-05-06 05:20:29 
Re: Portability: Harmony between PC and microcontroller
Chris Dollin <chris.do  2008-05-06 13:40:21 
Re: Portability: Harmony between PC and microcontroller
Eric Sosman <Eric.Sosm  2008-05-06 10:53:13 
Re: Portability: Harmony between PC and microcontroller
Keith Thompson <kst-u@  2008-05-06 12:28:04 
Re: Portability: Harmony between PC and microcontroller
=?ISO-8859-1?Q?Tom=E1s_=D  2008-05-06 06:06:35 
Re: Portability: Harmony between PC and microcontroller
Chris Dollin <chris.do  2008-05-06 16:16:18 
Re: Portability: Harmony between PC and microcontroller
"soscpd@[EMAIL PROTE  2008-05-06 07:32:43 
Re: Portability: Harmony between PC and microcontroller
=?ISO-8859-1?Q?Tom=E1s_=D  2008-05-06 07:49:48 
Re: Portability: Harmony between PC and microcontroller
"soscpd@[EMAIL PROTE  2008-05-06 09:40:46 
Re: Portability: Harmony between PC and microcontroller
=?ISO-8859-1?Q?Tom=E1s_=D  2008-05-06 10:19:09 
Re: Portability: Harmony between PC and microcontroller
"Herbert Rosenau&quo  2008-05-06 19:01:56 
Re: Portability: Harmony between PC and microcontroller
=?ISO-8859-1?Q?Tom=E1s_=D  2008-05-06 15:29:56 
Re: Portability: Harmony between PC and microcontroller
santosh <santosh.k83@[  2008-05-17 01:14:57 
Re: Portability: Harmony between PC and microcontroller
jacob navia <jacob@[EM  2008-05-16 22:24:28 
Re: Portability: Harmony between PC and microcontroller
Ben Pfaff <blp@[EMAIL   2008-05-16 13:42:16 
Re: Portability: Harmony between PC and microcontroller
jacob navia <jacob@[EM  2008-05-17 01:22:10 
Re: Portability: Harmony between PC and microcontroller
Ian Collins <ian-news@  2008-05-17 09:28:15 
Re: Portability: Harmony between PC and microcontroller
soscpd <soscpd@[EMAIL   2008-05-06 20:47:09 
Re: Portability: Harmony between PC and microcontroller
Bart van Ingen Schenau &l  2008-05-07 06:05:12 
Re: Portability: Harmony between PC and microcontroller
Flash Gordon <spam@[EM  2008-05-07 20:01:34 
Re: Portability: Harmony between PC and microcontroller
"robertwessel2@[EMAI  2008-05-07 11:45:58 
Re: Portability: Harmony between PC and microcontroller
Bart van Ingen Schenau &l  2008-05-08 02:46:03 
Re: Portability: Harmony between PC and microcontroller
Bart van Ingen Schenau &l  2008-05-08 03:14:57 
Re: Portability: Harmony between PC and microcontroller
=?ISO-8859-1?Q?Tom=E1s_=D  2008-05-16 16:12:50 
Re: Portability: Harmony between PC and microcontroller
Chris H <chris@[EMAIL   2008-05-17 09:00:09 
Re: Portability: Harmony between PC and microcontroller
Ian Collins <ian-news@  2008-05-17 20:18:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 3:54:46 CDT 2008.