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

on OSX new Xcode 12 causes a compile error in mosquitto/lib/mosquitto.c #1831

Closed
p-hagen opened this issue Sep 22, 2020 · 1 comment
Closed

Comments

@p-hagen
Copy link

p-hagen commented Sep 22, 2020

Tried to recompile my test platform for the first time since xcode has been upgraded.
now getting this error

~/GIT/domoticz/extern/mosquitto/lib/mosquitto.c:64:11: error: implicit declaration of function 'mach_absolute_time' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
This worked fine until the latest upgrade to xcode 12 where they implemented a fix:

Clang now reports an error when you use a function without an explicit declaration when building C or Objective-C code for macOS (-Werror=implicit-function-declaration flag is on). This additional error detection unifies Clang's behavior for iOS/tvOS and macOS 64-bit targets for this diagnostic. (49917738)

Workaround:
if you add #include <mach/mach_time.h> to mosquitto.c it compiles again

I have no idea if this occurs in parts of the mosquitto build.

Consider to make this a conditional include as the same code compiles without change on a Raspberry pi

@p-hagen p-hagen changed the title on OSX with Xcode 12 causes a compile error in mosquitto/lib/mosquitto.c on OSX new Xcode 12 causes a compile error in mosquitto/lib/mosquitto.c Sep 22, 2020
ralight added a commit that referenced this issue Sep 22, 2020
@ralight
Copy link
Contributor

ralight commented Sep 22, 2020

Thanks for the report, that is now fixed in the fixes branch.

@ralight ralight closed this as completed Sep 22, 2020
ralight added a commit that referenced this issue Dec 2, 2020
Closes #1831. Thanks to Tristan79 and andreas-kluge.
fAuernigg pushed a commit to fAuernigg/mosquitto that referenced this issue Jan 4, 2021
Closes eclipse#1831. Thanks to Tristan79 and andreas-kluge.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants