This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/80655] New: -Werror=format-truncation inconsistency between x86_32 and x86_64


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80655

            Bug ID: 80655
           Summary: -Werror=format-truncation inconsistency between x86_32
                    and x86_64
           Product: gcc
           Version: 7.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: krejzi at email dot com
  Target Milestone: ---

When building SPIRV-Tools with gcc-7.1.0 (stock, self-built), it builds fine
for 64 bit, but not for 32 bit (multilib setup).

The part of the code in question can be seen at [1]. I am getting the following
error when building SPIRV-Tools with "gcc -m32" and "g++ -m32"

In file included from
/home/armin/src/pacman/pkgbuild/vulkan-loader/src/Vulkan-LoaderAndValidationLayers32-sdk-1.0.46.0/external/spirv-tools/source/opt/ir_loader.cpp:17:0:
/home/armin/src/pacman/pkgbuild/vulkan-loader/src/Vulkan-LoaderAndValidationLayers32-sdk-1.0.46.0/external/spirv-tools/source/opt/log.h:
In function ‘void spvtools::Logf(const MessageConsumer&, spv_message_level_t,
const char*, const spv_position_t&, const char*, Args&& ...) [with Args =
{const SpvOp_&}]’:
/home/armin/src/pacman/pkgbuild/vulkan-loader/src/Vulkan-LoaderAndValidationLayers32-sdk-1.0.46.0/external/spirv-tools/source/opt/log.h:113:13:
error: null destination pointer [-Werror=format-truncation=]
     snprintf(longer_message.data(), longer_message.size(), format,
     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              std::forward<Args>(args)...);
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The very same package built fine with gcc-6.3.0.

[1]
https://github.com/KhronosGroup/SPIRV-Tools/blob/87a3f651e2416c830cb1eab410b3616068395985/source/opt/log.h#L111

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]