[cfe-commits] [PATCH] cindex.py - Make the compatibility check in cindex.py explicit
Tobias Grosser
tobias at grosser.es
Wed Sep 5 13:29:54 PDT 2012
On 09/05/2012 09:07 PM, Gregory Szorc wrote:
> I like it! Thank you for doing this.
>
> Specifically, I like how it defaults to strict and users must explicitly
> choose to pull out a foot gun.
>
> There's probably potential for hooking up clang_getClangVersion() to
> make the compatibility check even stricter. I'm think that the Python
> bindings would contain a minimal libclang version. This way, if function
> semantics ever change between libclang releases (I know the API is
> supposed to be backwards compatible, but you never know), we can detect
> that. Don't let this hold up committing this patch though.
Thanks, committed in r163238.
Regarding using clang_getClangVersion(). The comment says:
* \brief Return a version string, suitable for showing to a user, but
* not intended to be parsed (the format is not guaranteed to be
* stable).
So parsing it to check the version sounds dangerous? We may need to
establish another way to check for the libclang version? Maybe using a
function, that just gives a version number?
Another idea, I was playing with can be seen in the attached patch. I
did not finish thinking about it, so I don't yet submit it as an
official patch, but you may want to have a look.
Tobi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Report-function-when-something-is-failing.patch
Type: text/x-patch
Size: 3216 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120905/4c0fea47/attachment.bin>
More information about the cfe-commits
mailing list