EmbeddedRelated.com
Forums

MSP430 compiler recommendations

Started by edgershwin July 6, 2005
REMARKS ARE ENABLED...
I hate it when you are presuming that  the programmer is ALWAYS at fault!

BTW. This is an ERROR not a programming foot note ! If IAR wants to make
it's own class of error reporting
it has to educate it's constituency, not just throw a 1 line  obscure
instruction which is hard to find.


Alex



iginal Message ----- 
From: "Paul Curtis" <plc@plc@...>
To: <msp430@msp4...>
Sent: Wednesday, July 06, 2005 10:16 PM
Subject: RE: [msp430] MSP430 compiler recommendations A


> Hi Alex,
>
> > Here come my 2 bits too :)
> >
> > The following error is NOT detected by IAR:) It cost me 2
> > hours of debugging:(
> >
> > void main ()
> > {
> >         char t;
> >
> >             for ( t=0; t<= 1000;t++){}     // Bad Lint! FOR
> > loop never ends!
> >
> >             while(1){}
> >
> > }// END MAIN
> >
> > For $2700 I would expected that not to happen :(
>
> For $2700, you do:
>
> Remark[Pe236]: controlling expression is constant C:\Documents and
> Settings\plc\My Documents\IAR Embedded Workbench\test.cpp
>
> You need to enable remarks.  What's the point of a manual if nobody
> bothers to read it?  :-(  Could've saved yourself those two hours with
a
> quick scout through the manual perhaps?
>
> Some customers treat tech support an an online manual service when
> they're too lazy to bring up the Help > Search themselves.  I now
> usually send back a link to our web-based manuals.  And some customers
> bitch that they can't do so-and-so yet have never actually looked at
the
> documentation.
>
> --
> Paul Curtis, Rowley Associates Ltd  http://www.rowley.co.uk
> CrossWorks for MSP430, ARM, AVR and now MAXQ processors
>
>
>
> .
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>


Beginning Microcontrollers with the MSP430

Alex, 

> REMARKS ARE ENABLED...
> I hate it when you are presuming that  the programmer is 
> ALWAYS at fault!

Really?  Which version are you using?  I used MSP430 V3.21A.  I just
typed in your code, enabled remarks for the C compiler, and I got the
remark generated on compilation without drama.

> BTW. This is an ERROR not a programming foot note
! If IAR 
> wants to make it's own class of error reporting it has to 
> educate it's constituency, not just throw a 1 line  obscure 
> instruction which is hard to find.

It isn't an error as far as the compiler is concerned.  Compilers are
not endowed with empathy, sympathy, and understanding.

--
Paul Curtis, Rowley Associates Ltd  http://www.rowley.co.uk
CrossWorks for MSP430, ARM, AVR and now MAXQ processors

Paul, you are superficial...
I did not say that the code is not compiling! The problem is that it IS
compiling!
This type of error should never pass the Lint/Preprocessor phase!

Paul, are you working for IAR ?
Alex




----- Original Message ----- 
From: "Paul Curtis" <plc@plc@...>
To: <msp430@msp4...>
Sent: Thursday, July 07, 2005 9:37 AM
Subject: RE: [msp430] MSP430 compiler recommendations A


> Alex,
>
> > REMARKS ARE ENABLED...
> > I hate it when you are presuming that  the programmer is
> > ALWAYS at fault!
>
> Really?  Which version are you using?  I used MSP430 V3.21A.  I just
> typed in your code, enabled remarks for the C compiler, and I got the
> remark generated on compilation without drama.
>
> > BTW. This is an ERROR not a programming foot note ! If IAR
> > wants to make it's own class of error reporting it has to
> > educate it's constituency, not just throw a 1 line  obscure
> > instruction which is hard to find.
>
> It isn't an error as far as the compiler is concerned.  Compilers are
> not endowed with empathy, sympathy, and understanding.
>
> --
> Paul Curtis, Rowley Associates Ltd  http://www.rowley.co.uk
> CrossWorks for MSP430, ARM, AVR and now MAXQ processors
>
>
> .
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>


Alex, 

> Paul, you are superficial...
> I did not say that the code is not compiling! 

I know.

> The problem is that it IS compiling!

No, the problem you originally stated was that it compiled without
warning and that is not acceptable for a $2.7K compiler.  I merely
demonstrated that V3.21A of IAR's product does produce this warning.  As
I reckon I know most compiler front ends pretty well and what they're
capable of, I know theie specific front end can issue a note in this
case.

> This type of error should never pass the
Lint/Preprocessor phase!

You consider it a programming error, and hell, it might be.  But then
again, the compiler is telling you what it's doing and the compiler is
not allowed to issue an *error* diagnostic.  It can't do so because then
it would break the standard--every standard-conforming program *must* be
compiled by a standard-conforming compiler, and issuing an error in such
a case means that your compiler is not standard confirmant.

The pre-processor cannot find this error, it has zero context other than
for parentheses, brackets, and strings at the C level.

> Paul, are you working for IAR ?

*@'#!

--
Paul Curtis, Rowley Associates Ltd  http://www.rowley.co.uk
CrossWorks for MSP430, ARM, AVR and now MAXQ processors

I will have to say that just on this list, Paul does seem to answer more 
IAR questions than Ander :-)

Paul, send them a bill! :-)

At 06:57 AM 7/7/2005, alex@alex... wrote:

>Paul, you are superficial...
>I did not say that the code is not compiling! The problem is that it IS
>compiling!
>This type of error should never pass the Lint/Preprocessor phase!
>
>Paul, are you working for IAR ?
>Alex
>

// richard (This email is for mailing lists. To reach me directly, please 
use richard at imagecraft.com) 


Yeah, now we know what the "R" stands for in IAR....;-)

Michel

--- In msp430@msp4..., Richard <richard-lists@i...> wrote:
> I will have to say that just on this list, Paul
does seem to 
answer more 
> IAR questions than Ander :-)
> 
> Paul, send them a bill! :-)
> 
> At 06:57 AM 7/7/2005, alex@s... wrote:
> 
> >Paul, you are superficial...
> >I did not say that the code is not compiling! The problem is that 
it IS
> >compiling!
> >This type of error should never pass the Lint/Preprocessor phase!
> >
> >Paul, are you working for IAR ?
> >Alex
> >
> 
> // richard (This email is for mailing lists. To reach me directly, 
please 
> use richard at imagecraft.com)




This is not an error, it is a valid for statement. there are many types 
of for() statement that don't end, and that aren't required to. the
most 
obvious being for(;;); These are allowed. Whether or not you do it 
intentionally is another thing. This i the great thing about C. It 
doesn't nannny you and stop you doing things that are unusual, but 
leaves it up to you to know what you are doing. Mistakes are allowed, 
the compiler ccan't read your mind. You may well have wanted a never 
ending loop, or you may have some strange piece of code that manipulates 
t inside the for statement and forces an exit. I've seen far stranger 
things than that done.

Al

alex@alex... wrote:

>REMARKS ARE ENABLED...
>I hate it when you are presuming that  the programmer is ALWAYS at fault!
>
>BTW. This is an ERROR not a programming foot note ! If IAR wants to make
>it's own class of error reporting
>it has to educate it's constituency, not just throw a 1 line  obscure
>instruction which is hard to find.
>
>
>Alex
>
>
>
>iginal Message ----- 
>From: "Paul Curtis" <plc@plc@...>
>To: <msp430@msp4...>
>Sent: Wednesday, July 06, 2005 10:16 PM
>Subject: RE: [msp430] MSP430 compiler recommendations A
>
>
>  
>
>>Hi Alex,
>>
>>    
>>
>>>Here come my 2 bits too :)
>>>
>>>The following error is NOT detected by IAR:) It cost me 2
>>>hours of debugging:(
>>>
>>>void main ()
>>>{
>>>        char t;
>>>
>>>            for ( t=0; t<= 1000;t++){}     // Bad Lint! FOR
>>>loop never ends!
>>>
>>>            while(1){}
>>>
>>>}// END MAIN
>>>
>>>For $2700 I would expected that not to happen :(
>>>      
>>>
>>For $2700, you do:
>>
>>Remark[Pe236]: controlling expression is constant C:\Documents and
>>Settings\plc\My Documents\IAR Embedded Workbench\test.cpp
>>
>>You need to enable remarks.  What's the point of a manual if nobody
>>bothers to read it?  :-(  Could've saved yourself those two hours
with a
>>quick scout through the manual perhaps?
>>
>>Some customers treat tech support an an online manual service when
>>they're too lazy to bring up the Help > Search themselves.  I
now
>>usually send back a link to our web-based manuals.  And some customers
>>bitch that they can't do so-and-so yet have never actually looked
at the
>>documentation.
>>
>>--
>>Paul Curtis, Rowley Associates Ltd  http://www.rowley.co.uk
>>CrossWorks for MSP430, ARM, AVR and now MAXQ processors
>>
>>
>>
>>.
>>
>>
>>Yahoo! Groups Links
>>
>>
>>
>>
>>
>>
>>
>>    
>>
>
>
>
>.
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>
>  
>


Read this in a loud clear voice now!

kkkrrrgigigohuuuuufgttdrssgingopmeeengrtungngfdsfdfsmupmupmupmuuup!

Thanks
KD



alex@alex... wrote:

>REMARKS ARE ENABLED...
>I hate it when you are presuming that  the programmer is ALWAYS at fault!
>
>BTW. This is an ERROR not a programming foot note ! If IAR wants to make
>it's own class of error reporting
>it has to educate it's constituency, not just throw a 1 line  obscure
>instruction which is hard to find.
>  
>

Hi Alex!

No, that loop is not an error, it is a valid C statement.

However, I do agree with you that compilers should detect this and issue 
a remark -- in fact, our compiler does that in other similar situations, 
for example in "if" statements. I've added this to our internal 
wish-list, so it might turn up in future releases.

    -- Anders Lindgren, IAR Systems

-- 
Disclaimer: Opinions expressed in this posting are strictly my own and
not necessarily those of my employer.


Richard wrote:

>I will have to say that just on this list, Paul
does seem to answer more 
>IAR questions than Ander :-)
>  
>

Yes, Paul seems to be a real IAR fan!

> Paul, send them a bill! :-)


Or, better yet, hand deliver it -- I could take you on a tour-de-Uppsala 
and show you everything there is to see in our little town (which, 
honstely, isn't that much)... ;-)

    -- Anders

-- 
Disclaimer: Opinions expressed in this posting are strictly my own and
not necessarily those of my employer.