Common/log.h: time(2) needs <time.h>#250
Common/log.h: time(2) needs <time.h>#250jacmet wants to merge 1 commit intoDrive-Trust-Alliance:masterfrom
Conversation
Otherwise the build fails with:
In file included from ./linux/os.h:28:0,
from Common/DtaOptions.cpp:20:
./Common/log.h: In function ‘std::__cxx11::string NowTime()’:
./Common/log.h:349:12: error: ‘time’ was not declared in this scope
time(&t);
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
Could you please confirm that this patch is still needed and on what platform(s)? I've compiled current sedutil source against the buildroot2 2019.02.6 (LTS) target on Ubuntu 18.04.3 LTS (using a local.mk file to override source location) and I did not need to make this change. If it's needed only for specific build platforms, I'd rather document that need than make the change globally. |
|
It naturally depends on the toolchain you are using (E.G. you may get lucky and <time.h> gets included by something else, but 'man 2 time' clearly documents that the prototype is defined in time.h |
|
@oom-is what exactly do you mean with "is still needed"? I don't see any changes to this repo since the 1.15.1 release from 2017? |
|
[Side note: Thanks very much for Buildroot!] Sorry I wasn't at all clear. I opened a pull request #306 that updates sedutil to a newer Buildroot LTS target (2019.02.6) and newer Linux LTS kernel (4.14.146), and since sedutil was included in Buildroot as of 2018.11.1 that meant I had to override the Buildroot-specific patches and use a local source tree. When building that set of source+toolchain under Buildroot without your time.h patch, but otherwise with "stock" sedutil 1.15.1 source, everything compiled successfully as far as my testing has shown. Build host was Ubuntu 18.04.3 LTS. At the same time, your patch is technically correct as you've stated and Does No Harm - so the "curated" version that I'm putting together for $work will include your patch. I've had no luck reaching anyone at DTA even for questions about licensing of their native Windows GUI (SEDcontrol), so it appears there's little chance that any of these changes will be adopted into the official source tree any time soon. |
Otherwise the build fails with:
In file included from ./linux/os.h:28:0,
from Common/DtaOptions.cpp:20:
./Common/log.h: In function ‘std::__cxx11::string NowTime()’:
./Common/log.h:349:12: error: ‘time’ was not declared in this scope
time(&t);
Signed-off-by: Peter Korsgaard peter@korsgaard.com