[LLVMbugs] [Bug 15475] New: ccc-analyzer should match compiler's behavior when -E and -c used

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 8 11:30:04 PST 2013


            Bug ID: 15475
           Summary: ccc-analyzer should match compiler's behavior when -E
                    and -c used
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: michael.morrell at intel.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Although it really shouldn't happen, when both -E and -c are specified to the
compiler, it seems that -E wins (and -c is ignored).  The ccc-analyzer tool
should match this behavior, especially since xocdebuild invokes lines like

  cc -v -E -dM -arch i386 -x c -c /dev/null

where the -c is extraneous (I think xcodebuild should be fixed as well).

One possible fix to ccc-analyzer would be to change:

  if ($Arg =~ /^-(E|MM?)$/) { $Action = 'preprocess'; }
  elsif ($Arg eq '-c') { $Action = 'compile'; }


  if ($Arg =~ /^-(E|MM?)$/) { $Action = 'preprocess'; }
  elsif ($Action ne 'preprocess' && $Arg eq '-c') { $Action = 'compile'; }

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130308/165ad484/attachment.html>

More information about the llvm-bugs mailing list