Skip to content

Conversation

@bneradt
Copy link
Contributor

@bneradt bneradt commented Oct 11, 2022

This fixes GCC 12 compiler warnings for 9.1.x:

    LogFilter: fix NULL termination check (#8603)
    
    gcc-12 generated the following warning:
    
    proxy/logging/LogFilter.h: In function 'void wipeField(char**, char*, const char*)':
    proxy/logging/LogFilter.h:477:35: error: comparing the result of pointer addition '(new_param + 1)' and NULL [-Werror=address]
      477 |       if (new_param && (new_param + 1)) {
          |                        ~~~~~~~~~~~^~~~
    
    That is indeed a bug. `new_param + 1` will always be non-NULL even if new_param
    is NULL because 1 will be added to it. The intention was to check for the
    string's null terminator at the offset, which is done via a dereference.
    
    (cherry picked from commit 9966c9b8210ade388598aa42ac49f960126bfff7)


    Fix Clang 13.0.1 and GCC 12.0.1 Compiler Warnings (#8690)
    
    This cherry-picks two commits from master:
    
    Fix Clang 13.0.1 compiler warnings (#8685)
    
    This fixes a couple compiler warnings raised by Clang 13.0.1.
    
    (cherry picked from commit 96ce993fa53a05b872c5041629e3aac0bc15d56d)
    
    Fix warnings from GCC 12.0.1 (#8684)
    
    This patch fixes warnings generated by GCC 12.0.1. The warnings involved the
    use of the deprecated std::binary_function, std::unary_function, and
    std::iterator interfaces. The use of these was considered more confusing than
    explicitly declaring the associated types. Therefore this patch replaces the
    use of these deprecated interfaces with the declaration of the associated
    types.
    
    (cherry picked from commit 0ae34d4d1699d978f6938027efb2ecb9ae05c89a)
    (cherry picked from commit 1a37ae9efaf40ee19e3a735828c03ed25eac6a4f)

This cherry-picks two commits from master:

Fix Clang 13.0.1 compiler warnings (apache#8685)

This fixes a couple compiler warnings raised by Clang 13.0.1.

(cherry picked from commit 96ce993)

Fix warnings from GCC 12.0.1 (apache#8684)

This patch fixes warnings generated by GCC 12.0.1. The warnings involved the
use of the deprecated std::binary_function, std::unary_function, and
std::iterator interfaces. The use of these was considered more confusing than
explicitly declaring the associated types. Therefore this patch replaces the
use of these deprecated interfaces with the declaration of the associated
types.

(cherry picked from commit 0ae34d4)
(cherry picked from commit 1a37ae9)
gcc-12 generated the following warning:

proxy/logging/LogFilter.h: In function 'void wipeField(char**, char*, const char*)':
proxy/logging/LogFilter.h:477:35: error: comparing the result of pointer addition '(new_param + 1)' and NULL [-Werror=address]
  477 |       if (new_param && (new_param + 1)) {
      |                        ~~~~~~~~~~~^~~~

That is indeed a bug. `new_param + 1` will always be non-NULL even if new_param
is NULL because 1 will be added to it. The intention was to check for the
string's null terminator at the offset, which is done via a dereference.

(cherry picked from commit 9966c9b)
@bneradt bneradt added the Build work related to build configuration or environment label Oct 11, 2022
@bneradt bneradt added this to the 9.1.4 milestone Oct 11, 2022
@bneradt bneradt requested a review from bryancall October 11, 2022 22:51
@bneradt bneradt self-assigned this Oct 11, 2022
@bryancall bryancall merged commit 804af12 into apache:9.1.x Oct 11, 2022
@bneradt bneradt deleted the fix_91x_gcc12_compiler_warnings branch March 29, 2023 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build work related to build configuration or environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants