Ralph, ... All reads and writes to volatiles should be in execution order (guaranteed complete at sequence points, to be exact). Non-volatiles do not have...
Hi, I'd like to set the Brownout Reset for the SAM7S256. Is it possible to program it directly with Amontoc or Samba? So far I tried to program it through...
... Hi Paul! You can probably guess what project this is for based on previous correspondence we've had. Here's the code from the ATMEL USB Framework Core 1.02...
Hi Ralph, ... Sure. :-) ... [ snip ] ... Ok, here we need to be very precise and choose words carefully. In another life I reckon I would enjoy being a...
... Ralph I'm jumping back in here. I assume from looking at the code that pEndpoint and what it points to are not marked as volatile. If that is the case,...
Bill, ... There are two things here, perhaps being mixed together. 1. Tell the compiler to do things in order. 2. Tell the hardware to do things in order. (1)...
... Bill, The pEndpoint->State is marked volatile. It is possible that the interrupt enable happens after the state is set but before the rest of the struct is...
Ralph, ... Not enough! Just means that that member is volatile, nothing else. ... Sure is. ... Make pEndpoint a pointer to volatile: volatile WhateverStruct *...
... I could also move the state assignment to after the struct init, but I like your suggestion of declating pEndpoint volatile... ... And I've argued that...
... And if you find yourself getting confused about whether you are declaring a pointer to volatile or a volatile pointer get a copy of cdecl. It'll help ...
Ralph, ... I don't believe that will work in the general case -- well, at least I don't think it will. All it will do is guarantee that the state is assigned ...
Hi Robert, ... It'll ... Biggest ever mistake in C, and the designers regret the decision to make decls look like uses. Again, Wirth had it right in Pascal...
... Because this is read as: pEndpoint is a pointer to WhateverStruct which is volatile. ... Because this is read as: pEndpoint is a volatile pointer to...
... When you've written optimizing compilers that do all kinds of intermediate transformations on the intermediate code, preserving the order of statements is...
Hi, ... This is where I vehemently disagree with every bone in my being. I will agree that when lowing representation an inferior compiler might decide to...
... The compiler gives an error if you declare the same thing twice or forget to declare it at all (unless you use nested {} scopes which isn't common). ... I...
... The compiler gives an error if you declare the same thing twice or forget to declare it at all (unless you use nested {} scopes which isn't common). ... I...
Hi, ... That is not what I said. I said if mismatch the definition and use, the compiler will not generate an error. void foo(void) { int (*x)[3]; int u =...
... It accepts it only because x has been declared. That code is perfectly reasonable to me, except that x is uninitialized. Better to have: int (*x)[3] =...
Hi, ... It accepts it because it knows no better. Putting initialization of x to one side, EVERY ASSIGNMENT violates the C standard in one way or another. So...
... How do those assignments violate the C standard? I didn't know that initializing a local declaration wasn't standard. I'd rather use gcc that allows that...
Hi, Russel: You are missing the point, and: exactly the situation that you are missing the point is the prove, that you don't know the (possible) advantages of...
... I was thinking of what that vague question meant for quite a while. ... Oh, is that all. That's just a matter of remembering zero-based counting which i...
Russel, ... int u = (*x)[3]; This indexes one beyond the array pointed to by x. int v = *(x[3]); This indexes into the non-existent array x; x is a pointer,...
... When i say the code looked ok, it was from the context of the C standard and those individual lines rather than that obvious overrun error in the code as a...
Hi, ... No. As I pointed out, you have obviously demonstrated *exactly* why programmers have problems because not only have you missed the fact that I'm ...
Hi, ... in ... There are two classes of error in there; the C compiler and many programmers cannot diagnose them. If you write in a strictly-typed and...