Re: Diff Between ANSI C and Embedded C



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 \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/



.



Relevant Pages

  • Re: Cant understand this! (Help required please)
    ... Yes and some online courses NETG does not seem to understand what ... > New to programming: ... I have heard of comeau don't they make compilers too? ... An argument I have used many times myself, I want to learn standard C++, ...
    (alt.comp.lang.learn.c-cpp)
  • Re: GCC
    ... The header names changed explicitly to ... The Standard says that the standard ... that did not put iostream into the std namespace. ... and compilers change along with them. ...
    (Debian-User)
  • Re: subroutine stack and C machine model
    ... Herb has found out that a+bis ... Peter: But the STANDARD says... ... Most compilers have left to right evaluation as it happens. ... evidence appear to be more than one piece of evidence. ...
    (comp.lang.c)
  • Re: man 3 switch
    ... As C is an ISO standard, I sincerely doubt there would be any ... syntax and behaviour of the keywords between C compilers on any Unix-like ... of arithmetic operators of equal precedence in the same statement (in ... The languages themselves normally aren't. ...
    (Fedora)
  • Re: Is C99 the final C? (some suggestions)
    ... I for one would be happy if more compilers would ... this would require would be a standard minimum mantissa length. ... > supported by a mandatory compiler warning). ... > calls invocations that an implementation needs to support. ...
    (comp.lang.c)

Loading