Skip to content

pjsua_init: Fix for format-truncation error with GCC 13.2.0.#4903

Merged
sauwming merged 1 commit intopjsip:masterfrom
amubiera:pjsua-init-snprintf-truncated
Apr 6, 2026
Merged

pjsua_init: Fix for format-truncation error with GCC 13.2.0.#4903
sauwming merged 1 commit intopjsip:masterfrom
amubiera:pjsua-init-snprintf-truncated

Conversation

@amubiera
Copy link
Copy Markdown
Contributor

@amubiera amubiera commented Apr 2, 2026

Fix for warning as error under GCC 13.2.0:

pjsip/src/pjsua-lib/pjsua_core.c:1357:61: error: ‘__builtin___snprintf_chk’ output may be truncated before the last format character [-Werror=format-truncation=]
 1357 |             pj_ansi_snprintf(tname, sizeof(tname), "pjsua_%d", ii);
      |                                                             ^

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a GCC 13.2.0 -Wformat-truncation warning (treated as error) in pjsua_init() by increasing the size of the temporary thread-name buffer used when creating PJSUA worker threads.

Changes:

  • Increase the local tname buffer size used for worker thread names from 16 to 32 bytes to avoid potential snprintf truncation warnings under GCC 13.2.0.

@amubiera amubiera force-pushed the pjsua-init-snprintf-truncated branch from 48b414a to 7f2b05a Compare April 3, 2026 15:28
@amubiera amubiera force-pushed the pjsua-init-snprintf-truncated branch from 7f2b05a to cf63ebe Compare April 3, 2026 15:30
@sauwming sauwming requested a review from nanangizz April 6, 2026 03:16
@sauwming sauwming merged commit e68451a into pjsip:master Apr 6, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants