Skip to content

Warnings because of int template parameters #4645

@ZehMatt

Description

@ZehMatt

/build/_deps/fmt-src/include/fmt/base.h:2833:39: error: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Werror=sign-conversion] 2833 | detail::format_arg_store<context, sizeof...(T),

fmt/include/fmt/base.h

Lines 2401 to 2403 in bf3babf

template <typename Context, int NUM_ARGS, int NUM_NAMED_ARGS,
unsigned long long DESC>
struct format_arg_store {

I don't think that this should use int as the template parameter type, the arguments are typically unsigned as seen here:

fmt/include/fmt/base.h

Lines 2838 to 2841 in bf3babf

using vargs =
detail::format_arg_store<context, sizeof...(T),
detail::count_named_args<T...>(),
detail::make_descriptor<context, T...>()>;

sizeof returns size_t and not int.

I'm also getting a ton of truncation warnings with 32 bit builds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions