-
Notifications
You must be signed in to change notification settings - Fork 3k
lwip: Renamed header files to have lwip prefix to avoid name conflicts #3833
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
Conversation
38b94ca
to
39579c1
Compare
Currently conflicts with standard header errno.h PREFIX=lwip FILES=$(find features/FEATURE_LWIP/lwip-interface/lwip/src/include -ty pe f -a -name '*.h' -a ! -name ${PREFIX}'*') for i in ${FILES} ; do git mv $i $(dirname $i)/${PREFIX}_$(basename $i ) ; done sed -i 's/#include "\(.*${PREFIX}\/\)\('$(python -c 'print "\|".join(f .split("/")[-1][:-2] for f in __import__("sys").argv[1:])' ${FILES})'\ ).h"/#include "\1'${PREFIX}_'\2.h"/' $(find -regex '.*\.\(h\|hpp\|c\|c pp\)')
39579c1
to
4fcc2ca
Compare
I can't and this is because of our include paths (all in) :-/ Howver, from the above, we would use I think whats called base path inclusion "lwip/errno.h". lwip do it, we don't do this (we might want to rethink this at least to avoid situations like this?). Rename looks fine but we end up prefixing almost everything 😄 I wonder if suggestions from other projects how to include would not solve this? relative first (using base paths for istance), then system headers, would this break as well?
|
Previously we have renamed just the one header that collides. errno.h is used in lwip_err.c, sockets.h and under ppp directory if few modules which would need update. I would prefer that sort of correction also with this problem. Integrating new versions of lwip would demand less changes when only some of the modules needs update. Also I am not seeing c module changes in this pull request? |
Presumably the colliding code is doing If so, changing that would solve it. As far as I'm aware, standard C library headers are only guaranteed to be available with |
I think the above should fix it, because it seems lwIP itself uses a mixture of But I don't actually see any includes of just |
Okay, I see the error from the logs. The IAR manual does seem to say that Not very helpful behaviour, but technically allowable - the C99 spec does say behaviour is undefined if you have a file with any system header name in any of the "standard" search locations. I'd be inclined to go with the limited patch of renaming that errno.h, as in PR#3762, and lwIP themselves should probably reconsider - even if all directories aren't on the search path, that directory might be on it as the current directory sometimes, so they'd potentially hit that rule inside the lwIP build regardless. |
Can you report it there please? Thanks for providing the useful info! @geky Would you just rename that errno header file that conflicts? |
Yep, and as far as I can tell the compiler does not support other include path options that would allow a workaround. 🙁 This issue showed up in #3762, in an effort to get it in #3762 changes Otherwise we can just close this without concerns. |
I also see no IAR workaround. Okay, I vote for just having the #3762 fix. Reduced hassle of merging trumps consistency in this case, for me. |
Thanks for all the inputs and also for this patch. As we agreed, we close this one, we already renamed the conflicting header file referenced above. |
Currently conflicts with standard header errno.h. Results in a compilation error for IAR if user attempts to assign the standard errno.
Caused by these prs:
As far as I can tell the only solution is to rename the problematic file (lwip/errno.h). Let me know if anyone can think of another solution.
This pr updates all lwip header files with the lwip prefix for consistency. This is already the case for source files for unrelated issues with IAR.
Script (yes I should learn perl...):
cc @sg-, @bridadan, @kjbracey-arm, @mikaleppanen