3 ms·
> What if with "dangerous languages" like C you could turn off pointers You can't. C is a fundamentally defective language because it doesn't have the "memory
by raverbashing 6y ago
> What if with "dangerous languages" like C you could turn off pointers
You can't. C is a fundamentally defective language because it doesn't have the "memory slice"/"array" construct.
Of course you can work around it, but if you eliminate pointers then you can't do much with C. Heck you can't even print "Hello World" with it (well, ok, technically you can but not in the usual way).
- daotoad 6y agoYou could use MISRA guidelines for C. https://en.wikipedia.org/wiki/MISRA_C https://en.wikipedia.org/wiki/MISRA_C
- raverbashing 6y agoThey seems to be behind a paywall so I can't comment much on that But still, I believe you can't do much with C if you "shut down" pointers completely. Because strings are pointers in the end.
- m463 6y agomaybe the parent changed the link? the link appears to be wikipedia :)
- raverbashing 6y agoYes, the wiki has some recommendations (and I remember the C++ JSF standard) but if you follow the link to the actual document it seems to be behind a paywall
- m463 6y agowith my "use strict" perl example, the warnings had some carveouts. For example it had a carveout so that "$a" and "$b" didn't have to be declared (I think they are known variable names for sort?) Why not allow: printf("Hello world\n"); but turn off: acpi_ut_repair_name(&(*converted_name)[j]); or if (atomic_read(&(*per_cpu_ptr(sdd->sds, cpu))->ref))