Re: Diff Between ANSI C and Embedded C
- From: Chris Hills <chris@xxxxxxxxxxxx>
- Date: Wed, 24 Aug 2005 12:22:51 +0100
In article <1124868036.440155.316030@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
algrant@xxxxxxxxxxxxx writes
>Dag-Erling Smørgrav wrote:
>> I believe the point Chris was trying to make is that there is nothing
>> in the standard that precludes int64_t from being equivalent to signed
>> long on a 32-bit system.
>
>But MISRA-C is not mandating compilers to define their 'long'
>as 64 bits. You are correct that such a rule would not be
>incompatible with any requirements of the C standard.
>But MISRA-C is not a compiler standard. It is not defining
>a version of C with Java-like portability guarantees.
>Realistically, its authors realise that its readers have got
>to use whatever compilers are out there in the field.
>That is (as it says) the reason it completely ignores C99.
>
>And out in the field, on 32-bit integer machines, 'typedef
>signed long int64_t' is not only not necessarily true, it
>happens to be nearly always not true.
>
Also that table was given as an example. The rule is that you should
use typedefs to indicate the size of the int and that they should all be
fully specified as signed or unsigned.
You assign to int32_t which ever type is a 32 bit signed integer. if
the signed long is not 64 bits you don't typedef signed long as int64_t
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ chris@xxxxxxxxxxxx www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
.
- Follow-Ups:
- Re: Diff Between ANSI C and Embedded C
- From: kuyper
- Re: Diff Between ANSI C and Embedded C
- References:
- Diff Between ANSI C and Embedded C
- From: attelraghu24@xxxxxxxxx
- Re: Diff Between ANSI C and Embedded C
- From: Thad Smith
- Re: Diff Between ANSI C and Embedded C
- From: Chris Hills
- Re: Diff Between ANSI C and Embedded C
- From: algrant
- Re: Diff Between ANSI C and Embedded C
- From: Chris Hills
- Re: Diff Between ANSI C and Embedded C
- From: algrant
- Re: Diff Between ANSI C and Embedded C
- From: Chris Hills
- Re: Diff Between ANSI C and Embedded C
- From: algrant
- Re: Diff Between ANSI C and Embedded C
- From: Dag-Erling Smørgrav
- Re: Diff Between ANSI C and Embedded C
- From: algrant
- Diff Between ANSI C and Embedded C
- Prev by Date: Re: Diff Between ANSI C and Embedded C
- Next by Date: Re: Diff Between ANSI C and Embedded C
- Previous by thread: Re: Diff Between ANSI C and Embedded C
- Next by thread: Re: Diff Between ANSI C and Embedded C
- Index(es):
Relevant Pages
|
Loading