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 structs as function parameters are not supported #630

Open
IDKWNTCMF opened this issue Aug 31, 2023 · 0 comments
Open

Nested structs as function parameters are not supported #630

IDKWNTCMF opened this issue Aug 31, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@IDKWNTCMF
Copy link
Collaborator

Description
In C we can use nested structs as function parameters without parent struct typename. But wrappers for such functions cannot be compiled with C++ compilers

Example

struct MainStruct {
    struct InnerStruct {
        int fld;
    } str;
};

int get_fld(struct InnerStruct *str) {
    return str->fld;
}

To Reproduce
Steps to reproduce the behavior:

  1. Copy the example above to your project
  2. Generate tests for function get_fld
  3. Try to run generated tests

Expected behavior
Tests are supposed to be executed successfully.

Actual behavior
Compilation error.

Visual proofs (screenshots, logs)

error: variable has incomplete type 'struct InnerStruct'
    struct InnerStruct expected_str = {
@IDKWNTCMF IDKWNTCMF added the bug Something isn't working label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

1 participant