0% found this document useful (0 votes)
16 views1 page

AUTOSAR_readables

The document outlines essential guidelines and rules for C programming, particularly in the context of safety-critical systems, emphasizing the importance of documentation, error handling, and code traceability. It includes specific coding standards to prevent undefined behavior, ensure compliance with the C standard, and maintain code quality. Additionally, it highlights the need for unique identifiers and proper type usage to enhance code reliability and security.

Uploaded by

aunullahqaiser
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views1 page

AUTOSAR_readables

The document outlines essential guidelines and rules for C programming, particularly in the context of safety-critical systems, emphasizing the importance of documentation, error handling, and code traceability. It includes specific coding standards to prevent undefined behavior, ensure compliance with the C standard, and maintain code quality. Additionally, it highlights the need for unique identifiers and proper type usage to enhance code reliability and security.

Uploaded by

aunullahqaiser
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

RTOS Funda

https://www.freertos.org/implementation/a00002.html

CAN LIN FLEXRAY


https://www.prodigytechno.com/difference-between-lin-can-and-flexray-protocols

AUTOSAR C++14 Rules


https://in.mathworks.com/help/bugfinder/autosar-c-14.html?
s_tid=srchtitle_site_search_4_autosar%20c%252B%252B

MISRA C
https://in.mathworks.com/discovery/misra-c.html

Any implementation-defined behaviour on which the output of the program


depends shall be documented and understood.
All source files shall compile without any compilation errors.
All code shall be traceable to documented requirements.
Run-time failures shall be minimized.
Assembly language shall be encapsulated and isolated.
typedefs that indicate size and signedness should be used in place of the
basic numerical types.
If a function returns error information, then that error information shall be
tested.
Precautions shall be taken in order to prevent the contents of a header file
being included more than once.
The validity of values passed to library functions shall be checked.
Dynamic memory allocation shall not be used.
The validity of values received from external sources shall be checked.
The program shall contain no violations of the standard C syntax and
constraints, and shall not exceed the implementation's translation limits.
There shall be no occurrence of undefined or critical unspecified behaviour.
Emergent language features shall not be used.
A project shall not contain unreachable code.
There shall be no dead code.
The character sequences /* and // shall not be used within a comment.
Line-splicing shall not be used in // comments.
Octal and hexadecimal escape sequences shall be terminated.
External identifiers shall be distinct.
Identifiers declared in the same scope and name space shall be distinct.
An identifier declared in an inner scope shall not hide an identifier
declared in an outer scope.
Macro identifiers shall be distinct.
Identifiers shall be distinct from macro names.
A typedef name shall be a unique identifier.
A tag name shall be a unique identifier.
Identifiers that define objects or functions with external linkage shall be
unique.
Bit-fields shall only be declared with an appropriate type.
Single-bit named bit fields shall not be of a signed type.
Octal constants shall not be used.
A "u" or "U" suffix shall be applied to all integer constants that are
represented in an unsigned type.
The lowercase character "l" shall not be used in a literal suffix.
A string literal shall not be assigned to an object unless the object's type
is "pointer to const-qualified char".

_____________
Example of a Security Vulnerability: Buffer Overflow in C

You might also like