#165 C99 compliance: for (int i=0; ...

None
closed-fixed
None
5
2016-08-19
2006-09-21
No

At
http://sdcc.sourceforge.net/doc/sdccman.html/node171.html
you mention
for (int i=0; i<10; i++) /* is invalid in SDCC although
allowed in C99 */

I'd like to see this implemented.

Discussion

  • Philipp Klaus Krause

    A tricky bit is that we need another block in between the outer one and the loop body.
    I.e the following is ok, ad neither the outer or the inner variable i is in conflict with the variable i declared i the for.

    void f(void)
    {
        int i;
        for(int i = 4; i < 8; i++)
        {
            int i;
            j++;
        }
    }
    

    Philipp

     
  • Philipp Klaus Krause

    • assigned_to: Philipp Klaus Krause
    • Group: -->
     
  • Philipp Klaus Krause

    • status: open --> closed-fixed
     
  • Philipp Klaus Krause

    Implemented in revision #9724.

    Philipp

     
  • Diego Herranz

    Diego Herranz - 2016-08-18

    Thanks, Phillip, for this!

    I've just noticed that in the documentation, many double dashes (e.g. --stc-cXX) have been replaced by a single long one (e.g. –std-cXX)? 

    Cheers,
    Diego

     
    • Philipp Klaus Krause

      I still see the double dashes ins ections 3.1 and 3.3 where do you see the single long one?

      Philipp

       
  • Diego Herranz

    Diego Herranz - 2016-08-19
     
    • Philipp Klaus Krause

      Lyx did that automatically. But it soesn't change the .pdf. AFAIK -- is just notation for a single longunderscore, so wherever -- got changed to – in the source,it alread was – in the .pdf. Might make sense to check all places where the code changed from -- to see if they should have been escaped (or used code mode) instead.

      Philipp

       
      • Diego Herranz

        Diego Herranz - 2016-08-22

        You're right. They showed up as long dashes already on the PDF. Anyway, I've seen you've fixed it already.

        Thanks!

         

Log in to post a comment.