#4783 new defect

Fix issues when compiling dtc with Cygwin

Reported by: Ryan Long Owned by:
Priority: normal Milestone: 6.1
Component: tool/rsb Version: 6
Severity: normal Keywords:
Cc: Blocked By:


Currently, DTC is failing to build due to this check in checks.c. For some reason the argument into isxdigit is coming in as a char. I've brought it up to the maintainer, but he sees no reason to change it. Therefore, a patch is needed to get it to build.

1183 if (unitname[0] == '0' && isxdigit(unitname[1])) 1184 FAIL(c, dti, node, "unit name should not have leading 0s");
1185 }

Attachments (2)

0001-checks.c-Ensure-argument-is-an-integer.patch (773 bytes) - added by Ryan Long on 01/16/23 at 21:28:54.
0001-checks.c-Ensure-argument-is-an-integer-v2.patch (773 bytes) - added by Kinsey Moore on 01/30/23 at 17:11:39.
Make sure patch compiles within the build system.

Download all attachments as: .zip

Change History (9)

comment:1 Changed on 01/17/23 at 07:30:41 by Sebastian Huber

I can't find the associated thread on the DTC mailing list. Could you please provide a link?

comment:2 Changed on 01/20/23 at 15:02:48 by Joel Sherrill

See https://github.com/dgibson/dtc/issues/71 and I just posted. If you want to pile on, it would be appreciated. I don't think he sees the underlying issue.

Per https://en.cppreference.com/w/c/string/byte/isxdigit, the argument is an integer. GCC and LLVM warn for using a character as an array index and this is from the GCC manual.

Warn if an array subscript has type char. This is a common cause of error, as programmers often forget that this type is signed on some machines. This warning is enabled by -Wall.

Changed on 01/30/23 at 17:11:39 by Kinsey Moore

Make sure patch compiles within the build system.

comment:3 Changed on 01/30/23 at 17:21:10 by Kinsey Moore <kinsey.moore@…>

In afaeda7/rtems-source-builder:

dtc: Add patch to build for ticket 4783

This patch resolves a build error with dtc on cygwin until upstream
adopts a fix.

comment:4 Changed on 07/25/23 at 05:27:50 by Sebastian Huber

The patch makes no sense. You need an (unsigned char) cast. I added a comment to the dtc issue.

comment:6 Changed on 07/28/23 at 13:51:08 by Sebastian Huber

Pull request was merged. The next release will fix the issue.

comment:7 Changed on 07/28/23 at 13:51:26 by Sebastian Huber

Milestone: Indefinite6.1
Note: See TracTickets for help on using tickets.