[cfe-dev] clang --version question.

Jean-Daniel Dupas devlists at shadowlab.org
Wed Jul 15 17:11:29 PDT 2009


Hello,

Is there a reason why clang outputs its version in stderr instead of  
stdout when passing the --version flag ?
It prevents usage of this kind of script (used to detect type of  
parser in some projects):

if $cc --version 2>/dev/null | grep -q clang; then …

Note that this can be easily workaround by redirecting stderr in  
stdout instead of /dev/null, but I wonder if it's not simpler to  
change the driver to use stdout instead (see attached patch).

Regards
Jean-Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: driverout.patch
Type: application/octet-stream
Size: 941 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090716/a462e1f5/attachment.obj>
-------------- next part --------------





More information about the cfe-dev mailing list