Fwd: jextract throws "Invalid Cursor kind value: 602"
David Lloyd
david.lloyd at redhat.com
Mon Apr 4 13:41:00 UTC 2022
`_Static_assert` is in C11; if `<assert.h>` was included, then
`static_assert` is a macro which expands to `_Static_assert`. If
`static_assert` was found in a C header which does not include
`<assert.h>`, then the header file is not actually valid C11. If it was,
then it is, so IMO jextract should read it (and, I guess, ignore the
`_Static_assert`).
---------- Forwarded message ---------
From: Sundararajan Athijegannathan <sundararajan.athijegannathan at oracle.com>
Date: Sun, Apr 3, 2022 at 10:37 PM
Subject: Re: jextract throws "Invalid Cursor kind value: 602"
To: ahoj.41 at seznam.cz <ahoj.41 at seznam.cz>, panama-dev at openjdk.java.net <
panama-dev at openjdk.java.net>
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
<https://github.com/winfsp/winfsp/tree/7527155cb87c382cab1848b5bf65910c2dead291/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
<https://github.com/winfsp/winfsp/blob/7527155cb87c382cab1848b5bf65910c2dead291/inc/winfsp/winfsp.h>
--
- DML • he/him
More information about the panama-dev
mailing list