Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Under Keil C51, sizeof(pointer) is anything from 1 to 3. This is an extension, but a very popular one

I think this is the funniest thing in this all. You might cross all your t's and dot your i's, and you still may trip in a pitfall when your compiler/platform vendor happens to actually diverge from the standard. Such is life with decades old language with at least as many implementations.



Such is the price of using C on Harvard machines. It's even more pronounced on '51 as even the smallest $.5 chip has four (!) different address spaces (direct/register ram, indirect ram, xram and code) - and bigger chips have even more as they support memory banking. The real question is: why doesn't C support Harvard architecture natively, without ugly hacks?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: