Menu

#1 'D' and 'U' range limit not working

open
nobody
None
5
2012-10-22
2012-10-22
No

I compiled ecce with Clang and it generated a few warnings, some of which seem to be real bugs. This is with "Ecce V2.9 in C Mon Jul 16 00:13:55 CDT 2012". It seems that the intention was that the 'D' and 'U' commands by default should be limited to the current line. That didn't work because logical-and operators were used instead of bitwise-and.

Clang also found a few places where '%' was not escaped in a printf format string. I've attached a patch that fixes all clang's warnings.

Thanks for doing this btw. I love this kind of project, too much computing history gets lost.

Discussion

  • Peter De Wachter

     
    • Graham Toal

      Graham Toal - 2014-01-25

      The last release fixed the minor warnings from things like %% in formatting strings, which we'd discovered independently.

      This definitely looks like a bug:

      -   if (('D' != (command && (~(minusbit | plusbit)))) &&
      -                ((command && (~(minusbit | plusbit))) != 'U')) number = 0L;
      +   if (('D' != (command & (~(minusbit | plusbit)))) &&
      +                ((command & (~(minusbit | plusbit))) != 'U'))
      

      but it shouldn't have affected the range of the D command (eg D3/fred/) and indeed testing that feature it seems to be working OK - I can't duplicate a bug there. I think the bug above may affect the parsing of a reversed D command, such as D-3/text/ - I need to look at this closely before I make the obvious correction, just to understand how it was broken if nothing else.

      Sincere apologies for taking a year to respond to this - I don't believe we received a notice of your bug report at the time, and to be honest I only discovered that we had a bug area today!

      Graham <gtoal@gtoal.com>

       

Log in to post a comment.