You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error was pointing to struct list_element elem; and said the following:
"field elem has incomplete type"
In the implementation of struct list_element, everything was OK and I could not understand what the problem was. Finally, I saw a relatively simple defense against recursively including the list.h header:
#ifndefLIST_H#defineLIST_H
...
#endif// LIST_H
Replacing this construct with #pragma once, the compilation was finished successfully.
I don't even know where exactly I still have the LIST_H header included, but LIST_H is a very simple and common label.
It would be nice to replace it with something else, or use #pragma once (but this may not be available for some compilers, most likely outdated)
The text was updated successfully, but these errors were encountered:
In accordance with the name of the repository, you can use the UTILS_LIST_H option (and pattern UTILS_MODULE_H for all libraries of this repo), this option will already be more unique
Hi! I liked your implementation of linked list without dynamic allocation, and I decided to try it in a fairly large STM32-based embedded project.
It was unexpected, when compiling, an error appeared when declaring a my list element that included a
struct list_element
structure:The error was pointing to
struct list_element elem;
and said the following:In the implementation of
struct list_element
, everything was OK and I could not understand what the problem was. Finally, I saw a relatively simple defense against recursively including thelist.h
header:Replacing this construct with
#pragma once
, the compilation was finished successfully.I don't even know where exactly I still have the
LIST_H
header included, butLIST_H
is a very simple and common label.It would be nice to replace it with something else, or use
#pragma once
(but this may not be available for some compilers, most likely outdated)The text was updated successfully, but these errors were encountered: