Embedded C++ : to use STL or not?

I work on real-time embedded systems every day. Of course, my definition of embedded system may be different than yours. But we make full use of the STL and exceptions and do not experience any unmanageable problems. We also make use of dynamic memory (at a very high rate; allocating lots of packets per second, … Read more

Why is C++ template use not recommended in a space/radiated environment?

Notice that space-compatible (radiation-hardened, aeronautics compliant) computing devices are very expensive (including to launch in space, since their weight exceeds kilograms), and that a single space mission costs perhaps hundred million € or US$. Losing the mission because of software or computer concerns has generally a prohibitive cost so is unacceptable and justifies costly development … Read more

Writing a parser like Flex/Bison that is usable on 8-bit embedded systems

If you want an easy way to code parsers, or you are tight on space, you should hand-code a recursive descent parser; these are essentially LL(1) parsers. This is especially effective for languages which are as “simple” as Basic. (I did several of these back in the 70s!). The good news is these don’t contain … Read more

Difference between const & const volatile

An object marked as const volatile will not be permitted to be changed by the code (an error will be raised due to the const qualifier) – at least through that particular name/pointer. The volatile part of the qualifier means that the compiler cannot optimize or reorder access to the object. In an embedded system, … Read more

How do you implement a class in C? [closed]

That depends on the exact “object-oriented” feature-set you want to have. If you need stuff like overloading and/or virtual methods, you probably need to include function pointers in structures: typedef struct { float (*computeArea)(const ShapeClass *shape); } ShapeClass; float shape_computeArea(const ShapeClass *shape) { return shape->computeArea(shape); } This would let you implement a class, by “inheriting” … Read more

Understanding Linux /proc/pid/maps or /proc/self/maps

Each row in /proc/$PID/maps describes a region of contiguous virtual memory in a process or thread. Each row has the following fields: address perms offset dev inode pathname 08048000-08056000 r-xp 00000000 03:0c 64593 /usr/sbin/gpm address – This is the starting and ending address of the region in the process’s address space permissions – This describes … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)