Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-1544

CFEngine 3.6 compilation fails on old oses due to the presence of fprintf as a macro

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.1
    • Labels:
      None
    • Platform:
      Linux
    • Found in version (details):
      3.6.0 RELEASE

      Description

      Compiling CFEngine on 32-bit RHEL 5 fails due to the following error:
      <pre>
      In file included from bootstrap.c:298:
      bootstrap.inc:236:1: error: unterminated argument list invoking macro "fprintf"
      bootstrap.c: In function 'WriteBuiltinFailsafePolicyToPath':
      bootstrap.c:299: warning: statement with no effect
      bootstrap.c:299: error: expected ';' before ')' token
      bootstrap.c:299: error: expected statement before ')' token
      </pre>

      On old OSes, fprintf is a macro, not a real function, but the code looks like this (libpromises/bootstrap.c, line 296):
      <pre>
      fprintf(fout,
      // The bootstrap.inc file is generated by "make bootstrap-inc"
      #include "bootstrap.inc"
      );
      </pre>

      The problem vanishes when I do this:
      <pre>

      // The bootstrap.inc file is generated by "make bootstrap-inc"
      char * bootstrap_content =
      #include "bootstrap.inc"
      ;

      fprintf(fout, bootstrap_content);
      </pre>

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10040 Kristian Amlie
                Reporter:
                Kegeruneku Matthieu CERDA
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel