https://sourceware.org/bugzilla/show_bug.cgi?id=22245

            Bug ID: 22245
           Summary: Potential UB in bfd_set_error
           Product: binutils
           Version: 2.29
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: kryukov at frtk dot ru
  Target Milestone: ---

Hello

My student Kirill Nedostoev tried to build binutils 2.29.1 with Clang 7 and he
found a following message:

```
bfd.c:519:21: error: passing an object that undergoes default argument
promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs]`
      va_start (ap, error_tag);
```

The description of the actual problem is available on CERT site
https://www.securecoding.cert.org/confluence/display/cplusplus/EXP58-CPP.+Pass+an+object+of+the+correct+type+to+va_start

As a solution, we suggest to change signature of `bfd_set_error` in a following
way:

-void bfd_set_error (bfd_error_type error_tag, ...);
+void bfd_set_error (int error_tag, ...);

To get a patch, you may pull from https://github.com/pavelkryukov/binutils.git

Thanks,
Pavel Kryukov

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to