etwmc/Personal-HomeKit-HAP

Make error

Closed this issue · 15 comments

Hello,

I get an error at make.
When it come to PHKAccessory.cpp compil error:
PHKAccessory.cpp: In function 'void updateValueFromDeviceEnd(characteristics_, int, int, std::string)':
PHKAccessory.cpp:336:114: error: cannot pass objects of non-trivially-copyable type 'std::string {aka class std::basic_string}' through '...'
snprintf(broadcastTemp, 1024, "{"characteristics":[{"aid":%d,"iid":%d,"value":%s}]}", aid, iid, value);
^
makefile:42: recipe for target 'PHKAccessory.o' failed
make: *_* [PHKAccessory.o] Error 1

What's wrong ?
Thanks

etwmc commented

What platform and compiler version are you using?

Raspberry on raspbian

etwmc commented

Clang version?

How to check on raspberry ?

etwmc commented

Clang does not exist....
-bash: clang : commande introuvable

Need to install it ?

etwmc commented
  • $ clang -v
    Debian clang version 3.0-6.2 (tags/RELEASE_30/final) (based on LLVM 3.0)
    Target: arm-unknown-linux-gnueabihf
    Thread model: posix

$ gcc --version
gcc (Raspbian 4.8.2-21~rpi3rpi1) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Hello @etwmc I redownloaded the code and found the same issue, I tested with gcc gcc version 4.7.2 20121015 (Red Hat 4.7.2-5) (GCC) and clang version 3.4.2 both are poping the error, is it safe If I make a rollback? and use the previous version?

the problem is with the sprintf method, so I just commented, and the compiler continued

etwmc commented

Can you guys try the new push?
My Linux box haven't have gcc 4.8 for a while now

it says PHKAccessory.cpp:609:1: error: stray '\357' in program

yes it compiles now fine, my previous error was a strange char I added, thanx ;)

Works too
Thanks !