Buffer.cpp - CompileError with znc-latest #199

Closed
opened 2026-10-05 04:04:02 +02:00 by adam · 3 comments
Owner

I can't compile the znc-latest i just downloaded:

Building core object Buffer...
src/Buffer.cpp: In member function 'CString CBufLine::GetLine(const CClient&, const MCString&) const':
src/Buffer.cpp:47: error: cannot convert 'const long int_' to 'const time_t_' for argument '1' to 'tm* gmtime_r(const time_t_, tm_)'
gmake: *** [src/Buffer.o] Error 1

config.log: http://pastebin.com/tH9a0HnB

I can't compile the znc-latest i just downloaded: Building core object Buffer... src/Buffer.cpp: In member function 'CString CBufLine::GetLine(const CClient&, const MCString&) const': src/Buffer.cpp:47: error: cannot convert 'const long int_' to 'const time_t_' for argument '1' to 'tm\* gmtime_r(const time_t_, tm_)' gmake: **\* [src/Buffer.o] Error 1 config.log: http://pastebin.com/tH9a0HnB <!-- github-sync-id:10991919 -->
adam closed this issue 2026-10-05 04:04:02 +02:00
Author
Owner

This also happens with the latest OpenBSD 5.3 / i386 :(

config.log: http://pastebin.com/xn6wu3pc

This also happens with the latest OpenBSD 5.3 / i386 :( config.log: http://pastebin.com/xn6wu3pc <!-- github-comment-id:17384678 -->
Author
Owner

Open src/Buffer.cpp, go to line 43, replace the following:

struct tm stm;
memset(&stm, 0, sizeof(stm));
gmtime_r(&m_time.tv_sec, &stm);
char sTime[20] = {};

with this:

struct tm stm;
const time_t secs = m_time.tv_sec;
memset(&stm, 0, sizeof(stm));
gmtime_r(&secs, &stm);
char sTime[20] = {};

Build ZNC, tell @DarthGandalf that the above compiles, wait for him to commit this.

Open src/Buffer.cpp, go to line 43, replace the following: ``` struct tm stm; memset(&stm, 0, sizeof(stm)); gmtime_r(&m_time.tv_sec, &stm); char sTime[20] = {}; ``` with this: ``` struct tm stm; const time_t secs = m_time.tv_sec; memset(&stm, 0, sizeof(stm)); gmtime_r(&secs, &stm); char sTime[20] = {}; ``` Build ZNC, tell @DarthGandalf that the above compiles, wait for him to commit this. <!-- github-comment-id:17896849 -->
Author
Owner

@DarthGandalf : The above compiles !

@DarthGandalf : The above compiles ! <!-- github-comment-id:17906376 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#199