http://llvm.org/bugs/show_bug.cgi?id=15475

            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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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
following:

  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'; }

to:

  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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to