Quantcast
Viewing all articles
Browse latest Browse all 42

Answer by Lundin for Double-ended queue for Embedded Systems with different data size

Couple of bugs:

  • queue.c doesn't #include <string.h>.
  • Casting the pointer parameters passed to memset and memcpy isn't necessary, but can hide bugs.
  • Your macros do non-standard pointer arithmetic on void pointers. Don't do that, there's no need to use such pointless non-standard extensions and they are very unlikey to be supported by embedded systems compilers. Use uint8_t* instead.

Overall, make sure you are compiling with a standard C compiler and not a non-standard C++ compiler.


Viewing all articles
Browse latest Browse all 42

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>