Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-34755

GCC -Wstringop-truncation due to safe_strcpy()

Details

    Description

      MDEV-34266 removed a #pragma that would silence a GCC warning about possible missing NUL terminator when invoking strncpy(). It looks like the warning depends on some optimization settings.

      Initially I thought that the warning got smarter in GCC 14, which was recently made the default compiler in Debian Sid, but I found examples of the warnings in the build logs also with GCC 12.2.0.

      Attachments

        Issue Links

          Activity

            marko Marko Mäkelä created issue -
            marko Marko Mäkelä made changes -
            Field Original Value New Value
            marko Marko Mäkelä made changes -
            Description MDEV-34266 removed a {{#pragma}} that would silence a GCC warning about possible missing NUL terminator when invoking {{strncpy()}}. It looks like the check got smarter in GCC 14, which was recently made the default compiler in Debian Sid. MDEV-34266 removed a {{#pragma}} that would silence a GCC warning about possible missing NUL terminator when invoking {{strncpy()}}. It looks like the warning depends on some optimization settings.

            Initially I thought that the warning got smarter in GCC 14, which was recently made the default compiler in Debian Sid, but I found examples of the warnings in the build logs also with GCC 12.2.0.
            Summary g++-14 -Wstringop-truncation due to safe_strcpy() GCC -Wstringop-truncation due to safe_strcpy()
            marko Marko Mäkelä made changes -
            issue.field.resolutiondate 2024-08-14 06:52:58.0 2024-08-14 06:52:58.257
            marko Marko Mäkelä made changes -
            Fix Version/s 11.6.1 [ 29847 ]
            Fix Version/s 10.5.27 [ 29902 ]
            Fix Version/s 10.6.20 [ 29903 ]
            Fix Version/s 10.11.10 [ 29904 ]
            Fix Version/s 11.2.6 [ 29906 ]
            Fix Version/s 11.4.4 [ 29907 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.2 [ 28603 ]
            Fix Version/s 11.4 [ 29301 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.