json_spirit_writer_template.h - comparison is always true due to limited range of data type warning #1144

issue Diapolo opened this issue on April 24, 2012
  1. Diapolo commented at 4:19 PM on April 24, 2012: none

    I get a compiler warning for this line here: https://github.com/bitcoin/bitcoin/blob/master/src/json/json_spirit_writer_template.h#L78

    const wint_t unsigned_c( ( c >= 0 ) ? c : 256 + c );

    I don't know how to fix this, so I at least wanted to point the devs to it.

  2. laanwj commented at 4:24 PM on April 24, 2012: member

    I've seen this warning as well, however I've not fixed any warnings in json_spirit. I'm not sure we should do anything about it, as it's not our code.

  3. Diapolo commented at 5:05 PM on April 24, 2012: none

    Whose code is it and what is it used for?

  4. genjix commented at 5:13 PM on April 24, 2012: none

    it is used for serialising json in the json-rpc interface. that link you're talking about is not really an issue.

    what happens is that the method can be instantiated using a template parameter. so there are different string type definitions creating that function. sometimes it has a 'char' type which is unsigned - sometimes not. I guess that is unicode (wint_t) and non-unicode strings (char).

  5. Diapolo commented at 5:34 PM on April 29, 2012: none

    If this does not need to get fixed or can't be fixed by us, shall I close this?

  6. Diapolo closed this on May 18, 2012

  7. Diapolo commented at 11:26 AM on May 18, 2012: none

    Closing this, as no further comments were added.

  8. suprnurd referenced this in commit 9162c56419 on Dec 5, 2017
  9. lateminer referenced this in commit f770c3fbf8 on Jan 22, 2019
  10. Bushstar referenced this in commit ccddcd27d8 on Oct 21, 2020
  11. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 18:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me