Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning when compiling about discarded #2843

Closed
Steve8291 opened this issue Dec 11, 2022 · 1 comment
Closed

Warning when compiling about discarded #2843

Steve8291 opened this issue Dec 11, 2022 · 1 comment
Labels
2.x Related to ModSecurity version 2.x

Comments

@Steve8291
Copy link

Steve8291 commented Dec 11, 2022

This is a compile warning that I think would be easy to fix.
The output from my compiler is:

configure.ac:18: installing 'build/compile'
configure.ac:17: installing 'build/missing'
alp2/Makefile.am: installing 'build/depcomp'
mod_security2.c: In function ‘version’:
mod_security2.c:125:21: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 125 |     pcre_loaded_vrs = pcre_version();
     |                     ^

To Reproduce

cd ModSecurity/
./autogen.sh
./configure --disable-mlogc --enable-pcre-jit --enable-lua-cache
make clean
make

Server (please complete the following information):

  • ModSecurity version (and connector):
  • ModSecurity: 2.9.6
    ModSecurity: APR compiled version="1.6.5"; loaded version="1.6.5"
    ModSecurity: PCRE compiled version="8.39 "; loaded version="8.39 2016-06-14"
    ModSecurity: LUA compiled version="Lua 5.2"; installed version="Lua 5.2.4"
    ModSecurity: YAJL compiled version="2.1.0"
    ModSecurity: LIBXML compiled version="2.9.10"
  • WebServer: Apache 2.4.41
  • OS (and distro): Ubuntu 20.04.5 LTS (focal)

Additional context
Error occurs on line 125 of mod_security2.c
I think it could be fixed easily by changing line 109 of that same file to a const char pointer:
const char *pcre_vrs = NULL;
I don't have an easy way of testing this so I didn't want to submit a pull request.

@martinhsv
Copy link
Contributor

Resolved via 583b465

Thx.

@martinhsv martinhsv added the 2.x Related to ModSecurity version 2.x label Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to ModSecurity version 2.x
Projects
None yet
Development

No branches or pull requests

2 participants