Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Typical issues

thodnev edited this page Sep 26, 2017 · 1 revision

Below are listed and explained typical C-code pitfalls to avoid:

  • The usage of generic C-types (int, char, etc.):

    When generic types are used for embedded projects, the code becomes substantially less portable because on different platforms the same type could have different bit sizes. The resulting errors could become hardly discovered and bring the developer hours of interesting debug sessions.
    To avoid this, the C99 standard has a header with portable fixed-width types. The header is available for inclusion by the <stdint.h> name (or cstdint in C++).
    For more, follow this wiki link.

  • The infinite while (1) cycle outside of main():

    ...

Clone this wiki locally