Skip to content

Fixed GCC 15 build with -Wunterminated-string-initialization. #902

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

Merged

Conversation

xeioex
Copy link
Contributor

@xeioex xeioex commented May 2, 2025

In file included from src/njs_main.h:48,
from src/njs_diyfp.c:12:
src/njs_string.h: In function ‘njs_string_encode’: src/njs_string.h:229:36: error: initializer-string for array of ‘unsigned char’
truncates NUL terminator but destination lacks ‘nonstring’ attribute (
17 chars into 16 available) [-Werror=unterminated-string-initialization]
229 | static const u_char hex[16] = "0123456789ABCDEF";

@xeioex xeioex requested a review from VadimZhestikov May 2, 2025 00:34
@xeioex
Copy link
Contributor Author

xeioex commented May 2, 2025

See the discussion here: #871

Copy link
Contributor

@VadimZhestikov VadimZhestikov left a comment

Choose a reason for hiding this comment

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

Looks good

In file included from src/njs_main.h:48,
                 from src/njs_diyfp.c:12:
src/njs_string.h: In function ‘njs_string_encode’:
src/njs_string.h:229:36: error: initializer-string for array of ‘unsigned char’
	truncates NUL terminator but destination lacks ‘nonstring’ attribute (
	17 chars into 16 available) [-Werror=unterminated-string-initialization]
  229 |     static const u_char  hex[16] = "0123456789ABCDEF";
@xeioex xeioex force-pushed the fix_unterminated_string_initialization_warning branch from 15331ed to ac85b24 Compare May 2, 2025 01:35
@xeioex xeioex merged commit e3cfb4f into nginx:master May 2, 2025
1 check passed
@xeioex xeioex deleted the fix_unterminated_string_initialization_warning branch May 2, 2025 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants