Bug 27382 - build failure: Fails if fileno() is a macro due to a missing FILE * cast
Summary: build failure: Fails if fileno() is a macro due to a missing FILE * cast
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.36
: P2 normal
Target Milestone: ---
Assignee: Alan Modra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-09 01:01 UTC by Harry Sintonen
Modified: 2022-06-22 06:31 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Fix to a missing cast in fileno() usage (339 bytes, patch)
2021-02-09 01:01 UTC, Harry Sintonen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Harry Sintonen 2021-02-09 01:01:59 UTC
Created attachment 13211 [details]
Fix to a missing cast in fileno() usage

binutils/objcopy.c copy_file fileno() usage is missing a cast and hence the build fails on systems where fileno() is a macro.

Patch is included.
Comment 1 Sourceware Commits 2021-02-09 03:19:17 UTC
The binutils-2_36-branch branch has been updated by Alan Modra <amodra@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7651a4871c225925ffdfda0a8c91a6ed370cd9a1

commit 7651a4871c225925ffdfda0a8c91a6ed370cd9a1
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Feb 9 13:32:36 2021 +1030

    PR27382, build failure if fileno() is a macro
    
            PR 27382
            * objcopy.c (copy_file): Use bfd_stat.
Comment 2 Alan Modra 2021-02-09 03:20:56 UTC
Fixed again.  We lost the fix for this bug in reverting smart_rename changes.