Skip to content

Problem with msdos86 and msdos386 targets #365

Description

@johnsonjh

See https://github.com/johnsonjh/pcdos-crc (or https://GitLab.com/dps8m/crc).

This program currently works on over 50 different compilers on nearly 30 tested platforms, however, Ack targeting msdos86/msdos386 does not work, it seems to miscompile somehow and always shows a 0 CRC.

I didn’t investigate much further, however the UNIX V7 and CP/M-80 Ack builds have been fully tested and work correctly.

Activity

  1. johnsonjh commented on Jul 15, 2026

    @johnsonjh
    ContributorAuthor

    It looks like "rb" is broken:

    • test.c:
      #include <stdio.h>
      
      int main(void)
      {
        FILE * fp1 = fopen ("test.c", "r");
        FILE * fp2 = fopen ("test.c", "rb");
      
        printf (" r=%d\n", fgetc (fp1));
        printf ("rb=%d\n", fgetc (fp2));
      
        return 0;
      }
    • Result:
      $ /opt/ack/bin/ack -mmsdos86 -O3 test.c -o test.com
      $ emu2 test.com
       r=35
      rb=-1
  2. johnsonjh commented on Jul 15, 2026

    @johnsonjh
    ContributorAuthor

    @davidgiven I fixed it - PR coming.

  3. johnsonjh commented on Jul 15, 2026

    @johnsonjh
    ContributorAuthor

    @davidgiven #366 fixes the problem - binary mode file I/O was broken, it was always returning EOF and never what was read.

  4. added a commit that references this issue on Jul 15, 2026
    40b60ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions