??? 07/26/04 11:32 Read: times |
#74876 - RE: doub about strutc pointers Responding to: ???'s previous message |
Honestly, this is all a very valid ANSI C discussion, the structures were legal, the bugs more or less obvious... but don't you think that from a '51 standpoint it's all ridiculous? I mean, look, a function that takes a pointer to a structure containing pointer to another structure containing a pointer to a string.. Don't you find this code a bit too complicated for a small 8051? And with so many that simple bugs I honestly advise the thread author: Make it simple! One, two, at most 3 structs per program, no pointers to pointers (except in 2D arrays), otherwise you'll quickly get lost - debugging a program on a microcontroller IS harder than on PC, getting so deep is hardly ever necessary... Maybe if you wrote a TCP stack or something of similar complexity there would be a reason to build so deeply nested structures, but 99% of '51 projects don't need it - and work better without it.
BTW, would someone check what does (corrected) sprintf(auxBuf,"%c",par->INPS->szInterface); with structs defined as above compile to? My guess is it's over 100 ASM instructions. Similar thing could be written in ASM in less than 10 instructions... |
Topic | Author | Date |
doub about strutc pointers | 01/01/70 00:00 | |
RE: doub about strutc pointers | 01/01/70 00:00 | |
RE: doub about strutc pointers | 01/01/70 00:00 | |
What do you doubt? | 01/01/70 00:00 | |
RE: What do you doubt? | 01/01/70 00:00 | |
RE: What do you doubt? | 01/01/70 00:00 | |
RE: What do you doubt? | 01/01/70 00:00 | |
RE: What do you doubt? | 01/01/70 00:00 | |
RE: What do you doubt? | 01/01/70 00:00 | |
RE: What do you doubt? | 01/01/70 00:00 | |
RE: What do you doubt? | 01/01/70 00:00 | |
RE: undefined behaviour land | 01/01/70 00:00 | |
RE: What do you doubt? | 01/01/70 00:00 | |
Still unknown doubt | 01/01/70 00:00 | |
RE: doub about strutc pointers | 01/01/70 00:00 | |
Nothing 8051-specific here | 01/01/70 00:00 | |
RE: Nothing 8051-specific here | 01/01/70 00:00 | |
RE: doub about strutc pointers | 01/01/70 00:00 | |
RE: doub about strutc pointers![]() | 01/01/70 00:00 |