Skip to content

chore: Fix make test warning#90

Merged
kazuho merged 1 commit intoh2o:masterfrom
u5surf:fix_test
Apr 6, 2026
Merged

chore: Fix make test warning#90
kazuho merged 1 commit intoh2o:masterfrom
u5surf:fix_test

Conversation

@u5surf
Copy link
Copy Markdown
Contributor

@u5surf u5surf commented Sep 28, 2025

  • sprintf -> snprintf in test.c

I found build warnings on MacOS. so I fixed with snprintf following warning message.

% make test
cc -Wall -fsanitize=address,undefined  -o test-bin picohttpparser.c picotest/picotest.c test.c
test.c:480:25: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
        bufsz = (size_t)sprintf(buf, "%zx%s\r\n", chunk_len, extra);
                        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/_stdio.h:274:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.

* sprintf -> snprintf in test.c
@kazuho kazuho merged commit f4d94b4 into h2o:master Apr 6, 2026
@kazuho
Copy link
Copy Markdown
Member

kazuho commented Apr 6, 2026

Thank you for the PR; merged.

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