octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: warnings when installing the control pkg


From: John W. Eaton
Subject: Re: warnings when installing the control pkg
Date: Thu, 10 Jan 2019 12:29:14 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1

On 1/10/19 11:16 AM, "Markus Mützel" wrote:
"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.

OCTAVE_ENABLE_64 is defined in the octave-config.h header file that is included in all public header files.

OCTAVE_IDX_TYPE_FORMAT isn't, but we could add it to the octave-config.h header file if people think it would be useful. Otherwise, you can duplicate the conditional in your own code.

jwe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]