xlog 2.0.14 on macOS Sierra

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

xlog 2.0.14 on macOS Sierra

Elwood Downey
Just wanted to post a few nits encountered while building xlog on macOS:


error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
    removed from configure
    reran configure
  

 
 
callbacks_mainwindow_toolbar.c:343:34: error: equality comparison with extraneous parentheses
      [-Werror,-Wparentheses-equality]
                                        if ((preferences.awardsiota == 1))
                                             ~~~~~~~~~~~~~~~~~~~~~~~^~~~
callbacks_mainwindow_toolbar.c:343:34: note: remove extraneous parentheses around the comparison to silence
      this warning

    removed all such (( )) pairs 
    

 
    
    
callbacks_mainwindow_qsoframe.c:402:16: error: comparison of unsigned expression >= 0 is always true
      [-Werror,-Wtautological-compare]
                if (bandenum >= 0)
                    ~~~~~~~~ ^  ~
callbacks_mainwindow_qsoframe.c:433:16: error: comparison of unsigned expression >= 0 is always true
      [-Werror,-Wtautological-compare]
                if (modeenum >= 0)
                    ~~~~~~~~ ^  ~
    removed the tests
    

 
    
hamlib-utils.c:625:30: error: length modifier 'L' results in undefined behavior or no effect with 'd'
      conversion specifier [-Werror,-Wformat]
                g_string_printf (digits, "%Ld", programstate.rigfrequency);
                                          ~^~
hamlib-utils.c:625:30: note: did you mean to use 'll'?

    change to ll


Otherwise it built and runs fine. I have to say overall this is one of the very cleanest C programs I have seen in a long time. Well done.

73, Elwood, WB0OEW

 


_______________________________________________
Xlog-discussion mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/xlog-discussion
Reply | Threaded
Open this post in threaded view
|

Re: xlog 2.0.14 on macOS Sierra

Andy Stewart
On 12/29/2016 01:46 PM, Andy Stewart wrote:

>>     hamlib-utils.c:625:30: error: length modifier 'L' results in
>>     undefined behavior or no effect with 'd'
>>           conversion specifier [-Werror,-Wformat]
>>                     g_string_printf (digits, "%Ld",
>>     programstate.rigfrequency);
>>                                               ~^~
>>     hamlib-utils.c:625:30: note: did you mean to use 'll'?
>>
>>     *    change to ll*
>
> The code wants to print a long double.  My version of gcc accepts %Ld.
> Is there a way to express a long double for printf() with the compiler
> version you're using?
>

I'm sorry....I think you were trying to tell me "%lld".  I tried it and
it compiles but I haven't tested the code yet.

73,

Andy

--
Andy Stewart (KB1OIQ)
Founder:   Worcester Linux Users' Group
Founder:   Chelmsford Linux Meetup Group
President: PART of Westford, MA (WB1GOF)

_______________________________________________
Xlog-discussion mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/xlog-discussion
Reply | Threaded
Open this post in threaded view
|

Re: xlog 2.0.14 on macOS Sierra

Tomi Manninen
On 29.12.16 21:06, Andy Stewart wrote:

> On 12/29/2016 01:46 PM, Andy Stewart wrote:
>
>>>     hamlib-utils.c:625:30: error: length modifier 'L' results in
>>>     undefined behavior or no effect with 'd'
>>>           conversion specifier [-Werror,-Wformat]
>>>                     g_string_printf (digits, "%Ld",
>>>     programstate.rigfrequency);
>>>                                               ~^~
>>>     hamlib-utils.c:625:30: note: did you mean to use 'll'?
>>>
>>>     *    change to ll*
>>
>> The code wants to print a long double.  My version of gcc accepts %Ld.
>> Is there a way to express a long double for printf() with the compiler
>> version you're using?
>
> I'm sorry....I think you were trying to tell me "%lld".  I tried it and
> it compiles but I haven't tested the code yet.

FWIW, since this is using GLib, you could try the format specifiers
provided by GLib. See for example:

https://developer.gnome.org/glib/stable/glib-Basic-Types.html#G-GINT16-FORMAT:CAPS

--
/Tomi

_______________________________________________
Xlog-discussion mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/xlog-discussion