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

Got a bug for ya... #988

Open
kdschlosser opened this issue Jul 20, 2024 · 1 comment
Open

Got a bug for ya... #988

kdschlosser opened this issue Jul 20, 2024 · 1 comment

Comments

@kdschlosser
Copy link

kdschlosser commented Jul 20, 2024

I am not sure if this holds true for all types but I know it definitely does for structures.

typedef struct some_struct_t {
    ...
} some_struct_t;

produces this error

WARNING: Duplicate C++ declaration, also defined at API/misc/lv_lru:8.
Declaration is '.. cpp:struct:: some_struct_t'.

I am not 100% sure how Breathe makes the connections but technically speaking if this is done...

typedef struct {
    ...
} some_struct_t;

There should be no link formed when using ":cpp:type:`some_struct_t`" and ":c:struct:`some_struct_t`" shouldn't work either. This is because the structure is anonymous. If what is done in the first code block is done then both of those should link back to the structure without issue and there should not be an error that is generated.

This code

typedef struct _some_struct_t {
    ...
} some_struct_t;

is simply shorthand for this..

struct _some_struct_t {
    ...
};

typedef struct _some_struct_t some_struct_t;

But if I use this code...

typedef struct _some_struct_t {
    ...
} some_struct_t;

":c:struct:`some_struct_t`" will actually link to the structure which it shouldn't technically speaking. It should not provide a link because there is no structure that has the name some_struct_t There is a type that has that name. I can understand having it link like it does which is fine. However, it does need to allow having the type name be the same as the structure name. This would also hold true for enums and unions as well.

@michaeljones
Copy link
Collaborator

Thank you for the clear bug report. I'm afraid there isn't much work being done on the project at the moment. Please see the new issue on project funding.

In the mean time, I would be grateful if you could try to provide clearer titles for the two bugs you have reported as they are a little bit casual :)

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

No branches or pull requests

2 participants