This looks like a compiler problem. I need to write a 16-bit value to the EEPROM array to latch the address, but the compiler automatically turns it into two...
... It looks like a source error to me, not a compiler error. ... This looks correct. You have unreasonable expectations. ... A permanent fix would be to learn...
Mike McCarty
Mike.McCarty@...
Oct 9, 2006 5:38 pm
8454
... In a way perhaps you are right as it would only be for certain architectures. But I doubt you have any reason why not to make it work in this compiler...
... Well, here is my proof that either way, the compiler is wrong, and Mike agrees (unless of course he contradicts himself). /* JEFFS exper */ #include...
... [snip] ... I don't see where what I wrote is rude. If I called you stupid, or something like that, then yes. What I gave you is my best advice. Learn C. If...
Mike McCarty
Mike.McCarty@...
Oct 10, 2006 7:31 am
8458
... This code violates the Standard, and is incorrect, no question. I quote the Standard... 7.14 Signal handling <signal.h> [#1] The header <signal.h>...
Mike McCarty
Mike.McCarty@...
Oct 10, 2006 7:45 am
8459
... Mike, I beleive that you don't see it, but when you know someone is actively programming in C and you tell them to "learn the language" in this context,...
... I suppose you mean the compiler output and not my example source. ... Thank you for adding your explanations to the quote from the standard. It makes more...
... Exactly. Sorry I didn't make that clear. The output code does not guarantee atomic access. It either needs to use a byte sized integer, or disable...
Mike McCarty
Mike.McCarty@...
Oct 10, 2006 9:26 pm
8462
Mike McCarty wrote: [snip] ... AAAAKKK! Of course, I meant "this code is not uninterruptible". But you knew that. [snip] Mike -- ...
Mike McCarty
Mike.McCarty@...
Oct 10, 2006 10:00 pm
8463
... Strangely, the following symbols were not defined when I included <signal.h> test.c:274: error: `SIG_ATOMIC_MIN' undeclared (first use in this function) ...
... Hmm. Then this is not a conforming implementation in some ways. IOW, it is not C, but rather some other language which *looks* a lot like C. [#6] The two...
Mike McCarty
Mike.McCarty@...
Oct 11, 2006 12:20 am
8465
... Good thing we are developers. The idea then is that we fix it so that it can be C99 compliant, and send the "fix" (in whatever form) back to Stephane...
Hello, I've been using the compiler for about 3 years, and I've run into something I'm not sure how to handle. I am using the HC12D60. I'd like to write a C...
... Certainly that's one approach. To make <signal.h> work correctly, it would need much more work, including making signal() actually able to attach a routine...
Mike McCarty
Mike.McCarty@...
Oct 11, 2006 5:55 pm
8468
... This is easiest to do in assembly. http://hc11-ide.funkmunch.net/newbrain/kernel/k_lcd.s for one example. You can also use the linker to do it, specifying...
Thanks - I knew I could do it with assembly easier. I was kind of hoping to write the relocatable function in C, that's all. Any ideas which linker file...
... Do you have optimization enabled ? With -Os it does not emit the clr, but a movw #0,... instead. You might also do this: volatile word zero = 0; *(volatile...
... The problem with all such attempts to address this issue boils down to this: If the compiler changes, then the programmer has to go back and "fiddle around...
Mike McCarty
Mike.McCarty@...
Oct 12, 2006 11:43 am
8472
... Actually, this won't work, either, because it doesn't address the issue of an atomic, not just uninterruptible, 16 bit access. A specially-designed set of...
Mike McCarty
Mike.McCarty@...
Oct 12, 2006 12:01 pm
8473
Frank, I used a different approach that has allowed me to write C code and run it in RAM. I am using the MC9S12NE64 which has 4 16K Flash pages, with only 3 ...
... Yes I've had optimization enabled (-Os) because my extern inline functions did not compile correctly without it. So did you mean "Without -Os" it emits...
... Yeah, I use LMA and VMA pretty easily now. It's not "relocatable", but just loads to a different address (Flash) than the address it expects to execute at....
Oh no... the bugreport says it is fixed. I was right, he had agreed it was a bug. I didn't find it before because I only looked at bugreports still open. ...
... It says it was fixed in 2.92. I have 3.1 and without -Os I get two 8bit accesses. Ah, the difference is the offset: // v 3.1 toolchain, gcc parameters...
... Here with -Os (I use version 3.1 of the tool-chain). But the size of my function was different. So we learn, don't rely on optimization. I wonder, if the...
... Same version here (3.1). If you're saying -Os does not change it to clr-clr, are you sure you recompiled? Apparently it is the optimizer breaking it. It...
... Ah, the offset. Makes it completely backwards? This is all messed up 8-P With the offset it works without -O and not with With no offset it works with -O...
... I wonder what it emits for *((volatile word*) &offset[_eeprom_base]) = 0; Mike -- p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);} This...