jextract throws "Invalid Cursor kind value: 602"
ahoj.41 at seznam.cz
ahoj.41 at seznam.cz
Mon Apr 4 05:24:41 UTC 2022
Thank you Sundar,
The header in deed transitively contains `static_assert` [1].
Previous early access build (Build 17-panama+3-167 (2021/5/18)) works ok though using the same steps to reproduce.
Function that is being extracted doesn't contain the `static_assert` statement, the function is next to the `static_assert` statement so `static_assert` could likely be ignored.
If "jextract only supports C headers" doesn't only mean that C++ constructs cannot be extracted but also that presence of any C++ construct should prevent jextract from working then it would be nice to adjust the exception message. For example "`static_assert` statement encountered at <line>:<column> of file `/path/to/file.hpp`. C headers are only supported."
Adam
[1]: https://github.com/winfsp/winfsp/blob/0a91292e0502d6629f9a968a168c6e89eea69ea1/inc/winfsp/fsctl.h#L33
---------- Původní e-mail ----------
Od: Sundararajan Athijegannathan <sundararajan.athijegannathan at oracle.com>
Komu: ahoj.41 at seznam.cz <ahoj.41 at seznam.cz>, panama-dev at openjdk.java.net <panama-dev at openjdk.java.net>
Datum: 4. 4. 2022 5:36:44
Předmět: Re: jextract throws "Invalid Cursor kind value: 602"
.apply-styles P{margin-top:0;margin-bottom:0}
static assert is a C++11 construct. Are you trying to extract a C++ header?
Please note that jextract only supports C headers.
-Sundar
From: panama-dev <panama-dev-retn at openjdk.java.net> on behalf of ahoj.41 at seznam.cz <ahoj.41 at seznam.cz>
Sent: 04 April 2022 07:06
To: panama-dev at openjdk.java.net <panama-dev at openjdk.java.net>
Subject: jextract throws "Invalid Cursor kind value: 602"
Hello,
I'd like to report an issue of `jextract` tool and corresponding API `jdk.
incubator.jextract.JextractTool#main` that throws NoSuchElementException
with message "Invalid Cursor kind value: 602" when called on [winfsp.h][1].
The exception is thrown from method jdk.internal.clang.CursorKind#valueOf
(int) and is likely caused by missing enum item of jdk.internal.clang.
CursorKind corresponding to jdk.internal.clang.libclang.Index_h#CXCursor_
StaticAssert().
Environment:
Windows 10 64b
Early access build 19-panama+1-13 (2022/1/18) SOURCE=".:git:d8c0fe5918cb"
Steps to reproduce:
1. Download directory
https://github.com/winfsp/winfsp/tree/7527155cb87c382
cab1848b5bf65910c2dead291/inc/winfsp. E.g. into `C:\tmp`.
2. Run snippet
```
JextractTool.main(new String[] {
"--source",
"-d", "jextract-demo",
"-t", "jextract.demo",
"-I", "C:\\tmp",
"--include-function", "FspWin32FromNtStatus",
"C:\\tmp\\winfsp\\winfsp.h"
});
```
Expected result: no exception is thrown
Actual result:
NoSuchElementException is thrown.
Adam
[1]:
https://github.com/winfsp/winfsp/blob/7527155cb87c382cab1848b5bf65910c2
dead291/inc/winfsp/winfsp.h
More information about the panama-dev
mailing list