Skip to content

function _out_rev() #146

@sonikku2k

Description

@sonikku2k

I have managed to include this code as a submodule in a project for the MSP430 using TI's Code Composer Studio

In the function _out_rev(...)

the for loop is defined as
for (size_t i = len; i < width; i++) { out(' ', buffer, idx++, maxlen); }

Certain embedded C compilers do not support variable declaration in the for loop control statement.

A small change was made as follows to allow it to compile.

const size_t start_idx = idx;
  size_t i;

  // pad spaces up to given width
  if (!(flags & FLAGS_LEFT) && !(flags & FLAGS_ZEROPAD)) {
    for (i = len; i < width; i++) {
      out(' ', buffer, idx++, maxlen);
    }
  }

Line 202 in prinft.c

Also note that the test harness in the 'test' directory had to be excluded from the toolchain because it uses headers that do not exist in my system, nor in the toolchain and the opinion I got from various websites is that these headers are actually obsolescent

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