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
Compiling from source mosquitto v1.5 on FreeBSD bug #863
Comments
This is caused by defining _POSIX_C_SOURCE 200809 (in config.h). You could fix it by wrapping an #ifndef FreeBSD/#endif around that definition. |
@ptjm say that again? is some bsd compiler saying it's posix 200809 compatible, but it's not? that's a bsd bug, not somethign that should be fixed here. |
Correct? |
@denigmus - sorry the markdown parser turned my text into formatting. There should be two underscores on either side of FreeBSD.
@karlp - if you define _POSIX_C_SOURCE, you're supposed to write code which conforms to that version of the SUS. PF_UNSPEC is a non-standard BSDism and a conforming system will not define it if _POSIX_C_SOURCE is defined. That means using AF_UNSPEC, since that's what the standard defines, and while it's annoying that some systems don't define manifest constants which aren't in the standard while others do, what the standard says is that this is what is supposed to happen. Anyway, if you want to argue that mosquitto shouldn't compile on systems which don't define PF_UNSPEC in these circumstances, why not start with darwin, where _POSIX_C_SOURCE is deliberately not defined for exactly this reason in the #if part of the block cited above? |
@ptjm if mosquitto is misusing posix source guards, then mosquitto should be fixed. But fixed to use posix source properly. Just saying that it's posix source for one OS, and non-posix source for another isn't fixing anything, it's just making a tangled mess. From what you're saying, clearly, mosquitto should be using AF_UNSPEC, rather than hacking on these include guards. |
What is the result? |
Compiled |
Thanks. Shall I close this? |
Yep if no one wants to add this fix to the code ;) |
@toast-uz NO! stop this! what on earth makes you think this is resolved?! |
Did I misunderstand @denigmus comment? |
I'm not a person to decide what to do with it. I don't even know C. I just said that @ptjm's fix has helped me to compile on FreeBSD. |
If I ever get around to dealing with the eclipse IP, I'll submit a pull request to get at the root issue -- replacing PF_* with AF_* to match POSIX. |
Closes #863. Thanks to denigmus and Patrick TJ McPhee. Signed-off-by: Roger A. Light <[email protected]>
I've made the change of PF_* to AF_*, thanks for explaining where the actual issue was. If you are able to try compiling the |
Hi. I was able to compile the fixes branch on freebsd 11.2 using both clang and gcc |
Thanks for checking, I'm closing the issue. |
Closes #863. Thanks to denigmus and Patrick TJ McPhee. Signed-off-by: Roger A. Light <[email protected]>
git clone --branch v1.5 https://github.com/eclipse/mosquitto
cd mosquitto
gmake
FreeBSD 11.1-RELEASE-p8
gmake -v
GNU Make 4.2.1
Built for amd64-portbld-freebsd11.1
cc -v
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
Target: x86_64-unknown-freebsd11.1
Thread model: posix
InstalledDir: /usr/bin
The text was updated successfully, but these errors were encountered: