Skip to content

MDEV-39712: gcc 16 error with error=parentheses on mysql/service_encr…#5110

Open
grooverdan wants to merge 1 commit into
MariaDB:11.4from
grooverdan:MDEV-39712
Open

MDEV-39712: gcc 16 error with error=parentheses on mysql/service_encr…#5110
grooverdan wants to merge 1 commit into
MariaDB:11.4from
grooverdan:MDEV-39712

Conversation

@grooverdan
Copy link
Copy Markdown
Member

…yption.h

The assertion on assignment failed on gcc16.

The assertion added in MDEV-30389 seems intent on testing boundaries.

Re-use the my_valgrind.h header to approve a bunch of assertions around the contents of the output buffer, and the addressibility of the pointer and lengths passed to the encryption function.

note:
very much a test at the moment. Using my_valgrind.h as a header may by appropriate on headers. Having the boundary testing is useful however. The __has_include may not be as portable as desirable.

this is very much a test

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the ABI check documentation and logic, removes a side-effect assertion from several plugin headers, and integrates Valgrind memory instrumentation into the encryption service. The review feedback identifies portability issues with the use of the __has_include preprocessor operator and GNU-specific sed extensions, and suggests maintaining consistent C-style comments in public headers.

Comment on lines +29 to +31
#if __has_include(<my_valgrind.h>)
#include <my_valgrind.h>
#endif
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The __has_include preprocessor operator is not available in all compilers (it was introduced in GCC 5). Using it directly will cause a compilation error on older compilers that MariaDB still supports. It should be guarded with #ifdef __has_include to ensure portability.

Suggested change
#if __has_include(<my_valgrind.h>)
#include <my_valgrind.h>
#endif
#ifdef __has_include
#if __has_include(<my_valgrind.h>)
#include <my_valgrind.h>
#endif
#endif

Comment thread cmake/do_abi_check.cmake Outdated
EXECUTE_PROCESS(
COMMAND sed -e "/^# /d"
-e "/^[ ]*$/d"
-e "/^[ \t;]*$/d"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The use of \t in the sed regex is a GNU extension and is not portable to all sed implementations (e.g., BSD sed on macOS). It is safer to use a literal tab character, as was done in the previous version of this line, to maintain compatibility across different build environments.

                -e "/^[ 	;]*$/d"

Comment thread include/mysql/service_encryption.h Outdated
MEM_CHECK_ADDRESSABLE(dst, *dlen);
MEM_CHECK_ADDRESSABLE(key, klen);
MEM_CHECK_ADDRESSABLE(iv, ivlen);
// Verify buffers do not overlap
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the other comments in this file and to adhere to C-style comment standards for public headers, this should be converted to a block comment /* ... */.

Suggested change
// Verify buffers do not overlap
/* Verify buffers do not overlap */

@gkodinov gkodinov added the MariaDB Foundation Pull requests created by MariaDB Foundation label May 22, 2026
…yption.h

The assertion on assignment failed on gcc16.

The assertion added in MDEV-30389 seems intent on testing boundaries.

Re-use the my_valgrind.h header to approve a bunch of assertions
around the contents of the output buffer, and the addressibility
of the pointer and lengths passed to the encryption function.
@grooverdan grooverdan marked this pull request as ready for review May 25, 2026 04:01
@grooverdan grooverdan requested a review from vuvova May 25, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MariaDB Foundation Pull requests created by MariaDB Foundation

Development

Successfully merging this pull request may close these issues.

3 participants