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: Doug Stewart
Subject: Re: warnings when installing the control pkg
Date: Thu, 10 Jan 2019 12:49:51 -0500



On Thu, Jan 10, 2019 at 12:29 PM John W. Eaton <address@hidden> wrote:
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

was it wrong for me to replace  
OCTAVE_IDX_TYPE  with int


--
DASCertificate for 206392


reply via email to

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