[cfe-dev] Question: how to robustly detect available command line arguments

David Cole david.cole at kitware.com
Wed Jun 13 14:38:49 PDT 2012

On Mon, Jun 4, 2012 at 2:29 PM, david.cole <david.cole at kitware.com> wrote:

> I'm one of the CMake developers. We have an issue in our bug tracker that's
> related to clang's command line argument parsing:
> http://public.kitware.com/Bug/view.php?id=13194
> The bug reported is using this version of clang (MacOS X 10.7.3 with Xcode
> 4.3.2):
> $ /usr/bin/cc -v
> Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
> In the bug report, the CMake script code is trying to run clang to test if
> it recognizes a given command line argument. We expect to report that it
> does not support an argument if there's an error when using the argument
> trying to compile this snippet: "int main() { return 0;}"
> When given "-maltivec" it produces:
> clang: warning: argument unused during compilation: '-maltivec'
> By giving us that output, clang indicates that it does recognize the -m
> compiler argument, but warns us that -maltivec has not been used. (At
> least,
> that's how I read it.)
> So, here's the question: Can you recommend how to robustly detect whether
> or
> not clang supports a given command line argument? For both existing
> versions
> of clang in the wild, and future releases.
> The bug reporter in this case, wants us to recognize "argument unused
> during
> compilation" as an error, but I'm concerned that doing so will falsely
> report other valid command line arguments as unavailable...
> Thanks,
> David Cole
> Kitware, Inc.
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/Question-how-to-robustly-detect-available-command-line-arguments-tp4024269.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

Not a lot of response on this one, so let me re-phrase:

How can I tell what the output "clang: warning: argument unused during
compilation" means?

If I get it when using "-maltivec" does it mean that ANY -m argument would
be unused?

Or, what's the best way of knowing the set of valid possible values for -m?

David Cole
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120613/181e2502/attachment.html>

More information about the cfe-dev mailing list