Build error nasl_http.c.o

Problem (during make):

[ 48%] Building C object nasl/CMakeFiles/openvas_nasl_shared.dir/nasl_http.c.o
/opt/openvas-scanner/nasl/nasl_http.c: In function ‘_http_req’:
/opt/openvas-scanner/nasl/nasl_http.c:184:38: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘size_t {aka unsigned int}’ [-Werror=format=]
“Content-Length: %lu\r\n\r\n”, strlen (data));

Possible Fix (worked for me):
Change format specifier from “%lu” to “%u” in nasl/nasl_http.c line 184 as suggested by compiler.

System specs:
Linux 4.9.0-8-686-pae #1 SMP Debian 4.9.130-2 (2018-10-27) i686 GNU/Linux
gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)
GNU Make 4.1

Could you please provide which version of scanner you are trying to build?

Thanks for your post. Please report code related issues to the github bugtrackers (http://github.com/greenbone/) of the component in use.

For this special case an existing bug report already exists here:

1 Like

Sorry! Tried to build the latest version from https://github.com/greenbone/openvas-scanner.git

Allright. Sounds legit. I followed this hint:
" Should you notice error messages causing your build process to abort, do not hesitate to contact the developers using the Greenbone Community Portal. Don’t forget to include the name and version of your compiler and distribution in your message."

[https://github.com/greenbone/openvas-scanner/blob/master/INSTALL.md]

Mhhh, this is indeed a little bit misleading. There are currently two cases where the build could fail:

  1. A bug in the code like e.g. https://github.com/greenbone/openvas-scanner/issues/255
  2. Missing packages / not following the install instructions to install the prerequisites

Case 1. should go to the github issue trackers where case 2. would better fit into the community portal here. Let’s see if this could be pointed out in a better way, if you have any suggestions the following PR was created:

1 Like