Sujet : Re: What is wrong with malloc? (Was: So You Think You Can Const?)
De : nntp (at) *nospam* fulltermprivacy.com (Phillip)
Groupes : comp.lang.cDate : 08. Jan 2025, 17:45:01
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vlma2d$2qolo$1@dont-email.me>
References : 1 2 3 4
User-Agent : Mozilla Thunderbird
On 1/8/25 11:18 AM, David Brown wrote:
For people using 8051, COP8, 68HC05, PIC16 or other long outdated brain- dead microcontrollers, you don't get standard C support at all. You program these in a device-specific variant of C full of extensions and extra restrictions - and the support is as close to the subset of C99 that I described as it is to standard C90.
Just a point of reference, there are still several "brain-dead" systems in modern use today that aren't old, some being invested as late as 2019. That being said, your comment isn't completely accurate in that, there are some modern uses of things like the 6502 that can use standards-based C. In fact, you can use ANSI C89 and C90 with the 6502. I've done this for several modern pace makers as well as a smart prosthetic. So your statement is correct in 90% of cases but not all cases.
(Also most car manufacturer's use the 6502 and other variants for their digital input analog gauges and warning light controls on their dashboards.)
C89 and C90 are better for 8-bit systems then C99 and newer. Not that you can't do 8-bit on C99 but it's just not designed as well for it since C99 assumes you've moved on to at least 16-bit.
But this is all based on the OP's specific use case for their application. I just wanted to chime in since I do primarily work on modern embedded systems that don't use "modern" microcontrollers and CPU's since they are still used in a wide range of modern devices that people don't even realize.
-- Phillip Frabott----------- Adam: Is a void really a void if it returns?- Jack: No, it's just nullspace at that point.----------