Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested Struct definition ignored. #77

Closed
5c4lar opened this issue Jul 19, 2024 · 2 comments · Fixed by #78
Closed

Nested Struct definition ignored. #77

5c4lar opened this issue Jul 19, 2024 · 2 comments · Fixed by #78

Comments

@5c4lar
Copy link

5c4lar commented Jul 19, 2024

minimal example to reproduce this:

struct Fts3Table {
  struct Fts3Index {
    int nPrefix;
  } *aIndex;
};

static int fts3PrefixParameter(
  const char *zParam,
  int *pnIndex,
  struct Fts3Index **apIndex
){
  int a = sizeof(struct Fts3Index);
  return 0;
}
clang-extract -Wno-everything test.c -DCE_EXTRACT_FUNCTIONS=fts3PrefixParameter -DCE_OUTPUT_FILE=- -DCE_DUMP_PASSES
test.c:7:11: error: invalid application of 'sizeof' to an incomplete type 'struct Fts3Index'
    7 |   int a = sizeof(struct Fts3Index);
      |           ^     ~~~~~~~~~~~~~~~~~~
test.c:5:10: note: forward declaration of 'struct Fts3Index'
    5 |   struct Fts3Index **apIndex
      |          ^

Error on pass: ClosurePass

The dumped intermediate pass:

/** clang-extract: from test.c:7:1 */
static int fts3PrefixParameter(
  const char *zParam,
  int *pnIndex,
  struct Fts3Index **apIndex
){
  int a = sizeof(struct Fts3Index);
  return 0;
}
@giulianobelinassi
Copy link
Collaborator

@5c4lar see #78

@5c4lar
Copy link
Author

5c4lar commented Jul 20, 2024

@5c4lar see #78

@giulianobelinassi It works :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants