Closed scemama closed 2 weeks ago
@scemama this error has never occured before. There must be something wrong with your current branch. I don't even understand where these functions names come from.
I added a load of compiler warnings (in the debug_flags branch), and these warnings appear with these compiler flags. Without flags, everything is as usual. These appear with -Werror=missing-prototypes
This is because the generator doesn't create the prototypes for these functions in the trexio_text.h
file. I couldn't find where I should make the modification in the generator...
Hm, it should not because these function are sort of "private" for text back end so I have indeed excluded them from trexio_text.h
. I do not see it as an error as the code is there, compiles and works.
It would make sense to run this error check on front-end trexio.c
but I don't see the point in applying it to the back end files, sorry
Hm, it should not because these function are sort of "private" for text back end so I have indeed excluded them from
trexio_text.h
. I do not see it as an error as the code is there, compiles and works.
There is no error here. I turned the warnings into errors to make the code super-safe.
It is true that if there is no prototype and the function is defined before being used, it is fine. But if for some reason the order of concatenating files is swapped, or the order in which the functions are tangled changes, the code might break because of this.
Some prototypes of *_free*
functions are already defined in free_group_text.h
, but not all of them. I found where the prototypes were missing, and the warnings disappeared. I made the change in the debug_flags
branch.
I really want to get to the point where activating all possible warnings on trexio keeps the compiler silent. In that case, we can turn all warnings into errors on the github actions, and also activate the sanitizers, and the PRs will be really well checked. My Fortran bug would have been detected better than being lucky to have a segmentation fault. I was lucky to have a segfault, because only O2 was giving it!
The good thing with activating all those warnings is that it also fails because of unused parameters in functions. It has shown me many "safe" functions that are not really safe because they just call the non-safe version... I have fixed a few by making the relevant checks, but there is still a lot more to do. ;-)
Some function prototypes are missing in the text backend: