小编aga*_*sim的帖子

错误:此语句可能会失败 [-Werror=implicit-fallthrough=]

我正在尝试在 ubuntu 上编译 mitk,但出现此错误:

错误:此语句可能会失败 [-Werror=implicit-fallthrough=]

这里有一部分代码:

      /** Get memory offset for a given image index */
      unsigned int GetOffset(const IndexType & idx) const
      {
       const unsigned int * imageDims = m_ImageDataItem->m_Dimensions;

        unsigned int offset = 0;
        switch(VDimension)
        {
        case 4:
         offset = offset + idx[3]*imageDims[0]*imageDims[1]*imageDims[2];
        case 3:
        offset = offset + idx[2]*imageDims[0]*imageDims[1];
        case 2:
        offset  = offset + idx[0] + idx[1]*imageDims[0];
         break;
        }

        return offset;
      }
Run Code Online (Sandbox Code Playgroud)

请提供任何帮助,我将不胜感激。

c++ gcc build gcc-warning mitk

11
推荐指数
2
解决办法
2万
查看次数

标签 统计

build ×1

c++ ×1

gcc ×1

gcc-warning ×1

mitk ×1