Skip to content

ENH: cleanup of line_covered, make sure strings are not truncated (mo…#48

Merged
nno merged 4 commits intomasterfrom
enh/cleanup_line_covered
Dec 14, 2025
Merged

ENH: cleanup of line_covered, make sure strings are not truncated (mo…#48
nno merged 4 commits intomasterfrom
enh/cleanup_line_covered

Conversation

@nno
Copy link
Contributor

@nno nno commented Oct 24, 2025

This should get rid of the (harmless) message during compilation of mocov_line_covered.c.

mocov_line_covered.c:191:48: warning: ‘%s’ directive output may be truncated writing up to 98 bytes into a region of size between 2 and 100 [-Wformat-truncation=]
  191 |     snprintf(error_id, MAX_ERROR_ID_LENGTH, "%s%s", ERROR_ID_PREFIX,
      |                                                ^~
In file included from /usr/include/stdio.h:980,
                 from mocov_line_covered.c:23:
In function ‘snprintf’,
    inlined from ‘raise_mex_error’ at mocov_line_covered.c:191:5:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:54:10: note: ‘__snprintf_chk’ output between 1 and 197 bytes into a destination of size 100
   54 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   55 |                                    __glibc_objsize (__s), __fmt,
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   56 |                                    __va_arg_pack ());
      |                                    ~~~~~~~~~~~~~~~~~

Also, a few tweaks on the comments.

@nno nno marked this pull request as draft October 24, 2025 18:03
@nno
Copy link
Contributor Author

nno commented Oct 24, 2025

This is Work In Progress - there still is a warning message I have to look into. Please do not merge yet.

@nno nno marked this pull request as ready for review October 25, 2025 12:49
@nno
Copy link
Contributor Author

nno commented Oct 25, 2025

With some small changes the warning message is not shown anymore.

@nno nno requested review from Remi-Gau and jorgepz October 25, 2025 12:50
@nno
Copy link
Contributor Author

nno commented Dec 6, 2025

@jorgepz @Remi-Gau I didn't see a review yet. That's totally fine, but if there are no objections --- and since all checks pass, and the changes are minor --- I would like to merge into the main branch soon-ish.

Copy link
Member

@jorgepz jorgepz left a comment

Choose a reason for hiding this comment

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

go on! thanks

@nno nno merged commit 4646748 into master Dec 14, 2025
14 checks passed
@nno nno deleted the enh/cleanup_line_covered branch December 14, 2025 10:03
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