This is an archive of the discontinued LLVM Phabricator instance.

[test-suite] Add strings.h header to ClamAV and define _XOPEN_SOURCE=600 on AIX for ClamAV/archie-client.
ClosedPublic

Authored by amyk on Nov 23 2022, 2:18 PM.

Details

Summary

The ClamAV and archie-client tests are currently disabled on AIX, and we are now in the process
of re-enabling these tests and resolving the remaining issues.

As Clang now treats -Wimplicit-function-declaration and -Wint-conversion as errors,
ClamAV and archie-client are seen to exhibit error messages related to calls to undeclared functions
and incompatible integer to pointer conversions. To resolve these issues on AIX, we simply need to
include the appropriate headers, which are <strings.h> and <netdb.h>. Although the <netdb.h>
header is already included, the gethostname() function is not visible as we previously defined
_XOPEN_SOURCE=700 on AIX in rT000c7b8d78b12b5cc70ad4e69a4cdb1bab23f74d.
Thus, for ClamAV and archie-client specifically on AIX, we define _XOPEN_SOURCE=600 instead.

Diff Detail

Repository
rT test-suite

Event Timeline

amyk created this revision.Nov 23 2022, 2:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 23 2022, 2:18 PM
Herald added a subscriber: StephenFan. · View Herald Transcript
amyk requested review of this revision.Nov 23 2022, 2:18 PM
MaskRay accepted this revision.Nov 23 2022, 2:22 PM
This revision is now accepted and ready to land.Nov 23 2022, 2:22 PM

I think it may be useful to use some comments to annotate source file changes (in case we ever upgrade the libraries, e.g. if it becomes too painful to fix all the portability ourselves), but perhaps other changes don't do the annotation yet.

MultiSource/Applications/ClamAV/others.h
29

If this file is included under Windows, I am not sure there is a <strings.h>.
I see other files guarding out header inclusions with ifndef C_WINDOWS.

MultiSource/Applications/ClamAV/shared_cfgparser.c
27

Same comment.

amyk updated this revision to Diff 477630.Nov 23 2022, 3:26 PM

Update the patch to address review comments from @MaskRay and @hubert.reinterpretcast:

  • Guard #include <strings.h> with ifndef C_WINDOWS
  • Add comments to document the changes I've made
amyk edited the summary of this revision. (Show Details)Nov 23 2022, 8:28 PM