Uploaded image for project: 'FreeSWITCH'
  1. FreeSWITCH
  2. FS-10939

mod_cdr_mongodb: fails to build with gcc 7

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.18
    • Fix Version/s: 1.8.0
    • Component/s: mod_cdr_mongodb
    • Labels:
      None
    • Environment:
      OpenWrt
    • CPU Architecture:
      x86-64
    • Kernel:
      Linux
    • Userland:
      GNU/Linux
    • lsb_release:
      N/A
    • Compiler:
      gcc
    • Compiler Version:
      7.1.1
    • FreeSWITCH GIT Revision:
      38153a37ed620234c4c1cdcae5f09868cc164b12
    • GIT Master Revision hash::
      38153a37ed620234c4c1cdcae5f09868cc164b12
    • Target Version:

      Description

      Hi all,

      OpenWrt uses gcc 7 already for a few targets (target devices). The freeswitch (stable) build fails on these. The gcc used is gcc-7.1.1.

      gcc 7 compiles with "-Werror=format-truncation" and finds calls to snprintf() where it suspects that the output may be truncated:

      I've attached a txt file with the failures. It's visible that gcc thinks that the int bson_idx that gets written into char idx_buffer[4] could contain values that are bigger than 4 Bytes.

      For all I know we could just increase the char pointer idx_buffer from 4 Bytes to 12 Bytes and be done with it. But I could be wrong about that :-)

      I'll send a pull request with this change anyway.

      Can you please take a look at this when you get around to it? In the meantime I'll just pass -Wnoformat-truncation to prevent the builds from failing.

      Kind regards,
      Sebastian

        Attachments

          Activity

            People

            • Assignee:
              pressureman Daniel Swarbrick
              Reporter:
              Sebastian Sebastian Kemper
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: