[Pkg-clamav-devel] Bug#1016270: havp: FTBFS: logfile.cpp:111:22: error: ‘time’ was not declared in this scope

Lucas Nussbaum lucas at debian.org
Fri Jul 29 17:21:21 BST 2022


Source: havp
Version: 0.93-2
Severity: serious
Justification: FTBFS
Tags: bookworm sid ftbfs
User: lucas at debian.org
Usertags: ftbfs-20220728 ftbfs-bookworm

Hi,

During a rebuild of all packages in sid, your package failed to build
on amd64.


Relevant part (hopefully):
> g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include -Wall -g -O2 -DHAVE_CONFIG_H -c -o sockethandler.o sockethandler.cpp
> sockethandler.cpp: In member function ‘int SocketHandler::CheckForSSLData(int, int)’:
> sockethandler.cpp:584:20: warning: operation on ‘((SocketHandler*)this)->SocketHandler::Timeout.timeval::tv_sec’ may be undefined [-Wsequence-point]
>   584 |     Timeout.tv_sec = Timeout.tv_sec = Params::GetConfigInt("SSLTIMEOUT");
>       |     ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> logfile.cpp: In static member function ‘static void LogFile::AccessMessage(const char*, ...)’:
> logfile.cpp:111:22: error: ‘time’ was not declared in this scope
>   111 |         time_t now = time(NULL);
>       |                      ^~~~
> logfile.cpp:33:1: note: ‘time’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
>    32 | #include <cstring>
>   +++ |+#include <ctime>
>    33 | 
> logfile.cpp:112:19: error: variable ‘tm TmDate’ has initializer but incomplete type
>   112 |         struct tm TmDate = *localtime(&now);
>       |                   ^~~~~~
> logfile.cpp:112:29: error: ‘localtime’ was not declared in this scope
>   112 |         struct tm TmDate = *localtime(&now);
>       |                             ^~~~~~~~~
> logfile.cpp:112:29: note: ‘localtime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> logfile.cpp:113:9: error: ‘strftime’ was not declared in this scope
>   113 |         strftime(tmpdate, 50, TimeFormat.c_str(), &TmDate);
>       |         ^~~~~~~~
> logfile.cpp:113:9: note: ‘strftime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> logfile.cpp:115:32: warning: argument to ‘sizeof’ in ‘char* strncpy(char*, const char*, size_t)’ call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
>   115 |         strncpy(strt, tmpdate, sizeof(tmpdate));
>       |                                ^~~~~~~~~~~~~~~
> logfile.cpp: In static member function ‘static void LogFile::VirusMessage(const char*, ...)’:
> logfile.cpp:141:22: error: ‘time’ was not declared in this scope
>   141 |         time_t now = time(NULL);
>       |                      ^~~~
> logfile.cpp:141:22: note: ‘time’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> logfile.cpp:142:19: error: variable ‘tm TmDate’ has initializer but incomplete type
>   142 |         struct tm TmDate = *localtime(&now);
>       |                   ^~~~~~
> logfile.cpp:142:29: error: ‘localtime’ was not declared in this scope
>   142 |         struct tm TmDate = *localtime(&now);
>       |                             ^~~~~~~~~
> logfile.cpp:142:29: note: ‘localtime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> logfile.cpp:143:9: error: ‘strftime’ was not declared in this scope
>   143 |         strftime(tmpdate, 50, TimeFormat.c_str(), &TmDate);
>       |         ^~~~~~~~
> logfile.cpp:143:9: note: ‘strftime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> logfile.cpp:145:32: warning: argument to ‘sizeof’ in ‘char* strncpy(char*, const char*, size_t)’ call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
>   145 |         strncpy(strt, tmpdate, sizeof(tmpdate));
>       |                                ^~~~~~~~~~~~~~~
> logfile.cpp: In static member function ‘static void LogFile::ErrorMessage(const char*, ...)’:
> logfile.cpp:171:22: error: ‘time’ was not declared in this scope
>   171 |         time_t now = time(NULL);
>       |                      ^~~~
> logfile.cpp:171:22: note: ‘time’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> logfile.cpp:172:19: error: variable ‘tm TmDate’ has initializer but incomplete type
>   172 |         struct tm TmDate = *localtime(&now);
>       |                   ^~~~~~
> logfile.cpp:172:29: error: ‘localtime’ was not declared in this scope
>   172 |         struct tm TmDate = *localtime(&now);
>       |                             ^~~~~~~~~
> logfile.cpp:172:29: note: ‘localtime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> logfile.cpp:173:9: error: ‘strftime’ was not declared in this scope
>   173 |         strftime(tmpdate, 50, TimeFormat.c_str(), &TmDate);
>       |         ^~~~~~~~
> logfile.cpp:173:9: note: ‘strftime’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
> logfile.cpp:175:32: warning: argument to ‘sizeof’ in ‘char* strncpy(char*, const char*, size_t)’ call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
>   175 |         strncpy(strt, tmpdate, sizeof(tmpdate));
>       |                                ^~~~~~~~~~~~~~~
> logfile.cpp: In static member function ‘static void LogFile::AccessMessage(const char*, ...)’:
> logfile.cpp:118:14: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
>   118 |         write(Access_fd, strt, strlen(strt));
>       |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> logfile.cpp: In static member function ‘static void LogFile::VirusMessage(const char*, ...)’:
> logfile.cpp:148:14: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
>   148 |         write(Virus_fd, strt, strlen(strt));
>       |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> logfile.cpp: In static member function ‘static void LogFile::ErrorMessage(const char*, ...)’:
> logfile.cpp:178:14: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
>   178 |         write(Error_fd, strt, strlen(strt));
>       |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> make[3]: *** [Makefile:24: logfile.o] Error 1


The full build log is available from:
http://qa-logs.debian.net/2022/07/28/havp_0.93-2_unstable.log

All bugs filed during this archive rebuild are listed at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20220728;users=lucas@debian.org
or:
https://udd.debian.org/bugs/?release=na&merged=ign&fnewerval=7&flastmodval=7&fusertag=only&fusertagtag=ftbfs-20220728&fusertaguser=lucas@debian.org&allbugs=1&cseverity=1&ctags=1&caffected=1#results

A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

If you reassign this bug to another package, please marking it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects

If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.



More information about the Pkg-clamav-devel mailing list