Post Created date
if (variable) {
This is why C99 and C++ have the bool type—a bool variable can only ever be true or false, and assigning a non-bool value to a bool variable like b = x; is equivalent to b...
Thursday, 11 February 2021 - 17:16
Compilable scripting language for ATmega328p
If Scheme is more your thing, see
Thursday, 7 January 2021 - 22:56
main function of an AVR program
ki0bk wrote: awneil wrote:But GCC also insists that main() have a return type of int.   To void main(), or not to void main(), That is the question, Is it nobler to return...
Wednesday, 6 January 2021 - 18:40
Makefile question - how to do this?
Use the ifeq command with the shell command (running uname -m to get the machine type) to conditionally set libdir:
Tuesday, 29 December 2020 - 17:00
Best practice: buffer implementation
Is slow or bloated? I've seen many people say it's a good implementation.  
Saturday, 19 December 2020 - 00:37
integer promotion difference between gnu11 and gnu++11
You missed thisralphd wrote: I recently realized that despite starting to program in C more than 30 years ago, I've never read any of the official standards that were released...
Tuesday, 17 November 2020 - 00:23
register definition in MCU header file: PIC vs AVR
One of the biggest downsides to using spaces for indentation is that it overrides the personal preferences of anyone else who works on the code! I prefer an indentation...
Wednesday, 28 October 2020 - 23:20
register definition in MCU header file: PIC vs AVR
Use tabs for indentation and spaces for alignment. Then everyone can happily use the tab size of their choice in their own editor and the code still looks OK.   See...
Wednesday, 28 October 2020 - 18:01
failure to truncate to 16bits when -flto is on
This is code with undefined behavior, full stop, since signed integer overflow is not defined in C. The compiler is free to do anything it wants, or more likely, whatever it...
Thursday, 22 October 2020 - 18:49
Questions about PRNGs
If the seed and internal state of the PRNG are larger than the random numbers it produces (such as a 32-bit seed and internal state and a 16-bit output), then no, 14 will not...
Tuesday, 20 October 2020 - 18:24
in search of USB to TTL serial with DTR and RTS
Something like this?   Edit: I know it's not really a cable, but it's...
Thursday, 27 August 2020 - 23:53
Profiling 100s of structs to be 4 byte aligned.
Unless you do something funny (like use the "packed" attribute on a struct), all structs and struct members will be aligned appropriately for the target architecture. It would be...
Thursday, 27 August 2020 - 23:37