MMIX LOGO

MMIX Bug Report printf

Table of Content

Content

MMIXware Version

mmix-20110831

Bug Reported

Initial: 9/2/2011

Author

Andreas Scherer and Martin Ruckert

Description

Format-less uses of printf() produces warnings by some C compilers. Two change files by Andreas Scherer fix this: mmix-sim.ch and mmix-pipe.ch. The originals are hosted in the local branch of https://github.com/ascherer/mmix/.

The warnings uncover a bug in mmix-sim.w on line 3099, where the command_buf is taken from an input file. If the input file contains substrings like "%s" or "%d", it can crash mmix or cause other unexpected behaviour.

Proposed Patch

@x
      if (command_buf[0]==' ') printf(command_buf);
@y
      if (command_buf[0]==' ') printf("%s",command_buf);
@z

Discussion

The patch as given above is now part of the sources.

Please help to keep this site up to date! If you want to point out important material or projects that are not listed here, if you find errors or want to suggest improvements, please send email to email