"Doug Stewart" wrote:
I am seeing these new warnings.
any suggestion on how to fix it will be muchly appreciated.
common.cc:96:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘octave_idx_type’ {aka ‘longint’} [-Wformat=]
common.cc:96:18: warning: format ‘%d’ expects argument of type ‘int’, but
argument 5 has type ‘octave_idx_type’ {aka ‘longint’} [-Wformat=]
common.cc:98:18: warning: format ‘%d’ expects argument of type ‘int’, but
argument 3 has type ‘octave_idx_type’ {aka ‘longint’} [-Wformat=]
warning ("%s: unknown warning, iwarn = %d", name, index);
In the core this was solved with this macro:
#if defined (OCTAVE_ENABLE_64)
# define OCTAVE_IDX_TYPE_FORMAT PRId64
#else
# define OCTAVE_IDX_TYPE_FORMAT PRId32
#endif
And later in the code:
warning ("%s: unknown warning, iwarn = %" OCTAVE_IDX_TYPE_FORMAT, name, index);
I don't know if any of OCTAVE_ENABLE_64 or OCTAVE_IDX_TYPE_FORMAT is part of
the public API though.