Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-10632

Use of -save-temps causes warning diagnostic to not be emitted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low

      Please note that the -save-temps option is intended only for use in debugging an application when a developer would like to keep a compilation's intermediate file or representation that would normally be modeled as an internal data structure in the compiler.

      The compiler does not guarantee consistent diagnostic detection/reporting while using the -save-temps option.

      Original report:

      The attachment [^file.c]has these lines ...

          if (test < 10U);
          {
              func1(test);
          }

      Note the semi-colon on the first line.  While still legal C, it is probably a user error.

      Build it normally, and a warning diagnostic is emitted ...

      % tiarmclang -c file.c
      file.c:9:20: warning: if statement has empty body [-Wempty-body]
          if (test < 10U);
                         ^
      file.c:9:20: note: put the semicolon on a separate line to silence this warning
      1 warning generated.

      Add the option -save-temps and the diagnostic is not emitted ...

      % tiarmclang -c -save-temps file.c
      <nothing appears here>

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: