openscap icon indicating copy to clipboard operation
openscap copied to clipboard

Compilation Error: incompatible integer to pointer conversion returning 'int' from a function with result type 'char *'

Open jaredledvina opened this issue 2 years ago • 0 comments

Description of Problem:

Trying to build openscap from the https://github.com/OpenSCAP/openscap/releases/download/1.3.10/openscap-1.3.10.tar.gz release but make fails with:

[ 79%] Building C object src/OVAL/CMakeFiles/oval_object.dir/oval_message.c.o
/tmp/openscap-20240627-8095-tmbe9s/openscap-1.3.10/src/common/util.c:332:9: error: incompatible integer to pointer conversion returning 'int' from a function with result type 'char *' [-Wint-conversion]
        return strerror_r(errnum, buf, buflen);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

OpenSCAP Version:

1.3.10

Operating System & Version:

macOS Sonoma 14.5 (M1 arm64)

Steps to Reproduce:

  1. Follow https://github.com/OpenSCAP/openscap/blob/main/docs/developer/developer.adoc#1-building-openscap-on-linux to get the release
  2. When running any make command (make all, make openscap, or just make) it'll fail with the error above

Actual Results:

Error 2:

/tmp/openscap-20240627-8095-tmbe9s/openscap-1.3.10/src/common/util.c:332:9: error: incompatible integer to pointer conversion returning 'int' from a function with result type 'char *' [-Wint-conversion]
        return strerror_r(errnum, buf, buflen);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expected Results:

Binaries are compiled happily

Additional Information / Debugging Steps:

I'm actually trying to make a Homebrew formula to build and install the openscap binary. My hope is to be able to use oscap xccdf generate specifically less so the scanning features.

jaredledvina avatar Jun 27 '24 18:06 jaredledvina