Opened on 01/16/23 at 21:23:55
Last modified on 07/28/23 at 13:51:26
#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: | ||
Blocking: |
Description
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)
Change History (9)
Changed on 01/16/23 at 21:28:54 by Ryan Long
Attachment: | 0001-checks.c-Ensure-argument-is-an-integer.patch added |
---|
comment:1 Changed on 01/17/23 at 07:30:41 by Sebastian Huber
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.
-Wchar-subscripts 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
Attachment: | 0001-checks.c-Ensure-argument-is-an-integer-v2.patch added |
---|
Make sure patch compiles within the build system.
comment:3 Changed on 01/30/23 at 17:21:10 by Kinsey Moore <kinsey.moore@…>
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:5 Changed on 07/27/23 at 11:09:59 by Sebastian Huber
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: | Indefinite → 6.1 |
---|
I can't find the associated thread on the DTC mailing list. Could you please provide a link?