range error compiler warnings on ARM, comparing char to -1

55 views
Skip to first unread message

Alan

unread,
Oct 14, 2020, 5:44:25 PM10/14/20
to Ledger
I tried compiling Ledger on an ARM processor, where the bare `char` type defaults to unsigned. I got warnings at a handful of lines in a couple of source files:
  • query.cc
  • times.cc
  • token.cc
"warning: comparison is always false due to limited range of data type [-Wtype-limits]"

The bug is fairly obvious, and I would be happy to contribute a clean-up fix. But I wanted to ask first whether it would be welcome, because I assume I couldn't possibly be the first person to have encountered this.

Actually most, if not all, of the code isn't even really in play, IINM: it's dead/unreachable and/or redundant/irrelevant. So my proposed fix would be to just excise it.

Or am I missing something?

Norman Baatz

unread,
Jul 19, 2021, 7:21:09 PMJul 19
to Ledger
I’m getting this too. Is this an issue when running Ledger on ARM?

Alan Bram

unread,
Aug 18, 2021, 3:18:13 PMAug 18
to Ledger, norman...@gmail.com
Sorry for the late reply: this was languishing in my "spam" category, which I unfortunately do not look at often enough.

Yes, this occurs on ARM, as I mentioned. I believe it is safe to ignore (meaning, I believe it does not lead to incorrect calculations in Ledger), but IMHO it should definitely be cleaned up. I offered to fix it, but received no response.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Ledger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ledger-cli/bd8v3wiU6oo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ledger-cli+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ledger-cli/3adce81c-454d-4279-a9e2-4851cd38ccd8n%40googlegroups.com.

Martin Michlmayr

unread,
Aug 23, 2021, 4:28:46 AMAug 23
to ledge...@googlegroups.com, norman...@gmail.com
Alan, it would be great if you could submit a pull request through
GitHub.

* Alan Bram <alan...@cornell.edu> [2021-08-18 12:18]:
> Sorry for the late reply: this was languishing in my "spam" category, which
> I unfortunately do not look at often enough.
>
> Yes, this occurs on ARM, as I mentioned. I believe it is safe to ignore
> (meaning, I believe it does not lead to incorrect calculations in Ledger),
> but IMHO it should definitely be cleaned up. I offered to fix it, but
> received no response.
>
> On Mon, Jul 19, 2021 at 4:21 PM Norman Baatz <norman...@gmail.com> wrote:
>
> > I’m getting this too. Is this an issue when running Ledger on ARM?
> >
> > On Wednesday, October 14, 2020 at 11:44:25 PM UTC+2 Alan wrote:
> >
> >> I tried compiling Ledger on an ARM processor, where the bare `char` type
> >> defaults to unsigned. I got warnings at a handful of lines in a couple of
> >> source files:
> >>
> >> - query.cc
> >> - times.cc
> >> - token.cc
> >>
> >> "warning: comparison is always false due to limited range of data type
> >> [-Wtype-limits]"
> >>
> >> The bug is fairly obvious, and I would be happy to contribute a clean-up
> >> fix. But I wanted to ask first whether it would be welcome, because I
> >> assume I couldn't possibly be the first person to have encountered this.
> >>
> >> Actually most, if not all, of the code isn't even really in play, IINM:
> >> it's dead/unreachable and/or redundant/irrelevant. So my proposed fix would
> >> be to just excise it.
> >>
> >> Or am I missing something?
> >>
> > --
> >
> > ---
> > You received this message because you are subscribed to a topic in the
> > Google Groups "Ledger" group.
> > To unsubscribe from this topic, visit
> > https://groups.google.com/d/topic/ledger-cli/bd8v3wiU6oo/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to
> > ledger-cli+...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/ledger-cli/3adce81c-454d-4279-a9e2-4851cd38ccd8n%40googlegroups.com
> > <https://groups.google.com/d/msgid/ledger-cli/3adce81c-454d-4279-a9e2-4851cd38ccd8n%40googlegroups.com?utm_medium=email&utm_source=footer>
> > .
> >
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "Ledger" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ledger-cli/CACHqOS8xmnFyaa8h3OAEFnEbCP9BxDw98EuqEzzmTY9gsHzuMQ%40mail.gmail.com.

--
Martin Michlmayr
https://www.cyrius.com/

Alan

unread,
Aug 31, 2021, 5:18:06 PMAug 31
to Ledger
Will do.

Alan

unread,
Aug 31, 2021, 8:05:21 PMAug 31
to Ledger

Alan

unread,
Sep 13, 2021, 6:26:48 PMSep 13
to Ledger
(I added a note to this bug to indicate that it does lead to incorrect/garbage error reporting in some cases.)
Reply all
Reply to author
Forward
0 new messages